net.minecraftforge.common.BiomeDictionary Java Examples
The following examples show how to use
net.minecraftforge.common.BiomeDictionary.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TraverseWorld.java From Traverse-Legacy-1-12-2 with MIT License | 7 votes |
public static void register(Version versionAdded, Biome biome, BiomeType type, String name, int weight, boolean disabled, boolean canSpawn, VillageReplacements villageReplacements, RegistryEvent.Register<Biome> event, BiomeDictionary.Type... biomeDictTypes) { if (!disabled) { biome.setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name)); event.getRegistry().register(biome); for (BiomeDictionary.Type biomeDictType : biomeDictTypes) { BiomeDictionary.addTypes(biome, biomeDictType); } biomeList.add(new TraverseBiomeEntry(biome, type, weight, canSpawn, !TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES, versionAdded)); if (!TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES && villageReplacements != NO_REPLACEMENTS) { villageReplacementBiomes.put(biome, villageReplacements); } } }
Example #2
Source File: WorldGenBambooShot.java From Sakura_mod with MIT License | 6 votes |
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) { int x = chunkX * 16; int z = chunkZ * 16; Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z)); if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD) ||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) { return; } if (random.nextFloat() < SakuraConfig.bambooshot_weight / 4000.0F) { int posX = x+ world.rand.nextInt(16) + 8; int posZ = z+ world.rand.nextInt(16) + 8; BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true); if ((newPos != null) && (BlockLoader.BAMBOOSHOOT.canBlockStay(world, newPos))) { world.setBlockState(newPos, BlockLoader.BAMBOOSHOOT.getDefaultState(), 2); } } }
Example #3
Source File: WorldGenPepper.java From Sakura_mod with MIT License | 6 votes |
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) { int x = chunkX * 16; int z = chunkZ * 16; Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z)); if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD) ||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) { return; } if (random.nextFloat() < SakuraConfig.pepper_weight / 4000.0F) { int posX = x + world.rand.nextInt(16) + 8; int posZ = z + world.rand.nextInt(16) + 8; BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true); if ((newPos != null) && (BlockLoader.PEPPER_SPLINT.canPlaceBlockAt(world, newPos))) { world.setBlockState(newPos, BlockLoader.PEPPERCROP.getDefaultState(), 2); } } }
Example #4
Source File: WorldGenVanilla.java From Sakura_mod with MIT License | 6 votes |
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) { int x = chunkX * 16; int z = chunkZ * 16; Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z)); if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD) ||BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) { return; } if (random.nextFloat() < SakuraConfig.vanilla_weight / 4000.0F) { int posX = x + world.rand.nextInt(16) + 8; int posZ = z + world.rand.nextInt(16) + 8; BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true); if ((newPos != null) && (BlockLoader.VANILLA_SPLINT.canPlaceBlockAt(world, newPos))) { world.setBlockState(newPos, BlockLoader.VANILLACROP.getDefaultState(), 2); } } }
Example #5
Source File: TraverseWorld.java From CommunityMod with GNU Lesser General Public License v2.1 | 6 votes |
public static void register(Version versionAdded, Biome biome, BiomeType type, String name, int weight, boolean disabled, boolean canSpawn, VillageReplacements villageReplacements, RegistryEvent.Register<Biome> event, BiomeDictionary.Type... biomeDictTypes) { if (!disabled) { biome.setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name)); event.getRegistry().register(biome); for (BiomeDictionary.Type biomeDictType : biomeDictTypes) { BiomeDictionary.addTypes(biome, biomeDictType); } biomeList.add(new TraverseBiomeEntry(biome, type, weight, canSpawn, !TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES, versionAdded)); if (!TraverseConfig.disallowVillages && villageReplacements != NO_VILLAGES && villageReplacements != NO_REPLACEMENTS) { villageReplacementBiomes.put(biome, villageReplacements); } } }
Example #6
Source File: SettingsMesaTheme.java From minecraft-roguelike with GNU General Public License v3.0 | 6 votes |
public SettingsMesaTheme(){ this.id = ID; this.inherit.add(SettingsBase.ID); this.criteria = new SpawnCriteria(); List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>(); biomes.add(BiomeDictionary.Type.MESA); this.criteria.setBiomeTypes(biomes); this.towerSettings = new TowerSettings(Tower.ETHO, Theme.getTheme(Theme.ETHOTOWER)); Theme[] themes = {Theme.ETHOTOWER, Theme.ETHOTOWER, Theme.CRYPT, Theme.CRYPT, Theme.NETHER}; for(int i = 0; i < 5; ++i){ LevelSettings level = new LevelSettings(); level.setTheme(Theme.getTheme(themes[i])); levels.put(i, level); } }
Example #7
Source File: BiomeFilterAll.java From EnderZoo with Creative Commons Zero v1.0 Universal | 6 votes |
@Override public boolean isMatchingBiome(Biome biome) { if (isExcluded(biome)) { return false; } if (!names.isEmpty() && !names.contains(biome.getRegistryName())) { return false; } for (BiomeDictionary.Type type : types) { if (!BiomeDictionary.hasType(biome, type)) { return false; } } return true; }
Example #8
Source File: AbstractBiomeFilter.java From EnderZoo with Creative Commons Zero v1.0 Universal | 6 votes |
protected boolean isExcluded(Biome candidate) { for (BiomeDictionary.Type exType : typeExcludes) { if (BiomeDictionary.hasType(candidate, exType)) { if (Config.spawnConfigPrintDetailedOutput) { System.out.print("Excluded " + candidate.getBiomeName() + ", "); } return true; } } for (ResourceLocation exName : nameExcludes) { if (exName != null && exName.equals(candidate.getRegistryName())) { System.out.print("Excluded " + candidate.getRegistryName() + ", "); return false; } } return false; }
Example #9
Source File: WorldGenCandelilla.java From GardenCollection with MIT License | 6 votes |
@Override public void generate (Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { int x = chunkX * 16; int z = chunkZ * 16; BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z); if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.COLD) || BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER) || BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WET) || BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WASTELAND) || BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) return; if (!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY)) return; if (random.nextInt(10) > 0) return; generate(world, random, x, world.getActualHeight() - 1, z); }
Example #10
Source File: SoyGenerator.java From TofuCraftReload with MIT License | 6 votes |
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { int x = chunkX * 16; int z = chunkZ * 16; Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z)); if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) { return; } if (random.nextFloat() < 70 / 4000.0F) { int posX = x + world.rand.nextInt(16) + 8; int posZ = z + world.rand.nextInt(16) + 8; BlockPos newPos = WorldUtil.findGround(world, new BlockPos(posX, 0, posZ), true, true, true); if ((newPos != null) && (BlockLoader.SOYBEAN.canPlaceBlockAt(world, newPos))) { world.setBlockState(newPos, BlockLoader.SOYBEAN.getDefaultState().withProperty(BlockSoybean.AGE, random.nextInt(4)), 2); } } }
Example #11
Source File: DimensionProperties.java From AdvancedRocketry with MIT License | 6 votes |
/** * Adds all biomes of this type to the list of biomes allowed to generate * @param type */ public void addBiomeType(BiomeDictionary.Type type) { ArrayList<Biome> entryList = new ArrayList<Biome>(); entryList.addAll(BiomeDictionary.getBiomes(type)); //Neither are acceptable on planets entryList.remove(Biome.getBiome(8)); entryList.remove(Biome.getBiome(9)); //Make sure we dont add double entries Iterator<Biome> iter = entryList.iterator(); while(iter.hasNext()) { Biome nextbiome = iter.next(); for(BiomeEntry entry : allowedBiomes) { if(BiomeDictionary.areSimilar(entry.biome, nextbiome)) iter.remove(); } } allowedBiomes.addAll(getBiomesEntries(entryList)); }
Example #12
Source File: EntityHelper.java From Moo-Fluids with GNU General Public License v3.0 | 5 votes |
public static void addSpawnFromType(final Class<? extends EntityLiving> entityClass, final int weightedProb, final int min, final int max, final EnumCreatureType typeOfCreature, final BiomeDictionary.Type... biomeTypes) { final ArrayList<Biome> biomes = new ArrayList<Biome>(); for (final BiomeDictionary.Type biomeType : biomeTypes) { biomes.addAll(BiomeDictionary.getBiomes(biomeType)); } EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature, biomes.toArray(new Biome[biomes.size()])); }
Example #13
Source File: CommandRouteBiome.java From minecraft-roguelike with GNU General Public License v3.0 | 5 votes |
@Override public void execute(ICommandContext context, List<String> args) { ArgumentParser ap = new ArgumentParser(args); IWorldEditor editor = context.createEditor(); Coord pos; if(!ap.hasEntry(0)){ pos = context.getPos(); } else { int x; int z; try { x = CommandBase.parseInt(ap.get(0)); z = CommandBase.parseInt(ap.get(1)); } catch (NumberInvalidException e) { context.sendMessage("Failure: Invalid Coords: X Z", MessageType.ERROR); return; } pos = new Coord(x, 0, z); } context.sendMessage("Biome Information for " + pos.toString(), MessageType.SPECIAL); Biome biome = editor.getInfo(pos).getBiome(); context.sendMessage(biome.getBiomeName(), MessageType.SPECIAL); Set<BiomeDictionary.Type> biomeTypes = BiomeDictionary.getTypes(biome); String types = ""; for(BiomeDictionary.Type type : biomeTypes){ types += type.getName() + " "; } context.sendMessage(types, MessageType.SPECIAL); return; }
Example #14
Source File: SettingsIceTheme.java From minecraft-roguelike with GNU General Public License v3.0 | 5 votes |
public SettingsIceTheme(){ this.id = ID; this.inherit.add(SettingsBase.ID); this.criteria = new SpawnCriteria(); List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>(); biomes.add(BiomeDictionary.Type.SNOWY); this.criteria.setBiomeTypes(biomes); this.towerSettings = new TowerSettings(Tower.PYRAMID, Theme.getTheme(Theme.ICE)); }
Example #15
Source File: SpawnContext.java From minecraft-roguelike with GNU General Public License v3.0 | 5 votes |
@Override public boolean includesBiomeType(List<Type> biomeTypes) { for(BiomeDictionary.Type type : biomeTypes){ if(biomeHasType(type)) return true; } return false; }
Example #16
Source File: BiomeFilterAny.java From EnderZoo with Creative Commons Zero v1.0 Universal | 5 votes |
@Override public boolean isMatchingBiome(Biome biome) { if (isExcluded(biome)) { return false; } if (names.contains(biome.getRegistryName())) { return true; } for (BiomeDictionary.Type type : types) { if (BiomeDictionary.hasType(biome, type)) { return true; } } return false; }
Example #17
Source File: SakuraBiomes.java From Sakura_mod with MIT License | 5 votes |
public static void register(IForgeRegistry<Biome> registry) { registry.register(BAMBOOFOREST.setRegistryName("bamboo_forest")); BiomeManager.addBiome(BiomeManager.BiomeType.WARM,new BiomeManager.BiomeEntry(BAMBOOFOREST, 8)); BiomeDictionary.addTypes(BAMBOOFOREST, HOT, WET, DENSE, JUNGLE); registry.register(MAPLEFOREST.setRegistryName("maple_forest")); BiomeManager.addBiome(BiomeManager.BiomeType.WARM,new BiomeManager.BiomeEntry(MAPLEFOREST, 8)); BiomeDictionary.addTypes(MAPLEFOREST, FOREST); }
Example #18
Source File: ModBiomes.java From Wizardry with GNU Lesser General Public License v3.0 | 5 votes |
@SubscribeEvent public static void register(RegistryEvent.Register<Biome> evt) { IForgeRegistry<Biome> r = evt.getRegistry(); r.registerAll(BIOME_UNDERWORLD); // BiomeDictionary.addTypes(BIOME_TORIKKI, BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.SPOOKY, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.WASTELAND); BiomeDictionary.addTypes(BIOME_UNDERWORLD, BiomeDictionary.Type.VOID, BiomeDictionary.Type.SPOOKY, BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.DRY, BiomeDictionary.Type.COLD); // BiomeDictionary.addTypes(BIOME_TORIKKISEA, BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.SPOOKY, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.WASTELAND,BiomeDictionary.Type.WATER); }
Example #19
Source File: TraverseWorld.java From Traverse-Legacy-1-12-2 with MIT License | 5 votes |
public static void register(Version versionAdded, Biome biome, BiomeType type, String name, int weight, boolean disabled, boolean canSpawn, RegistryEvent.Register<Biome> event, BiomeDictionary.Type... biomeDictTypes) { register(versionAdded, biome, type, name, weight, disabled, canSpawn, NO_VILLAGES, event, biomeDictTypes); }
Example #20
Source File: GTWorldGen.java From GT-Classic with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { Biome biomegenbase = world.getBiome(new BlockPos(chunkX * 16 + 16, 128, chunkZ * 16 + 16)); // Any Biome GTOreGenerator.generateBasicVein(GTBlocks.oreIridium, GTConfig.generation.iridiumGenerate, GTConfig.generation.iridiumSize, GTConfig.generation.iridiumWeight, 0, 128, Blocks.STONE, world, random, chunkX, chunkZ); // Jungle Biomes if (BiomeDictionary.hasType(biomegenbase, Type.JUNGLE)) { GTOreGenerator.generateBasicVein(GTBlocks.oreSheldonite, GTConfig.generation.sheldoniteGenerate, GTConfig.generation.sheldoniteSize, GTConfig.generation.sheldoniteWeight, 10, 30, Blocks.STONE, world, random, chunkX, chunkZ); } // Hot Biomes if (BiomeDictionary.hasType(biomegenbase, Type.HOT)) { GTOreGenerator.generateBasicVein(GTBlocks.oreRuby, GTConfig.generation.rubyGenerate, GTConfig.generation.rubySize, GTConfig.generation.rubyWeight, 0, 48, Blocks.STONE, world, random, chunkX, chunkZ); } // Ocean Biomes if (BiomeDictionary.hasType(biomegenbase, Type.OCEAN) || BiomeDictionary.hasType(biomegenbase, Type.BEACH)) { GTOreGenerator.generateBasicVein(GTBlocks.oreSapphire, GTConfig.generation.sapphireGenerate, GTConfig.generation.sapphireSize, GTConfig.generation.sapphireWeight, 0, 48, Blocks.STONE, world, random, chunkX, chunkZ); } // Forest or Plains Biomes if (BiomeDictionary.hasType(biomegenbase, Type.FOREST) || (BiomeDictionary.hasType(biomegenbase, Type.PLAINS))) { GTOreGenerator.generateBasicVein(GTBlocks.oreBauxite, GTConfig.generation.bauxiteGenerate, GTConfig.generation.bauxiteSize, GTConfig.generation.bauxiteWeight, 50, 120, Blocks.STONE, world, random, chunkX, chunkZ); } if (world.provider.getDimensionType().equals(DimensionType.OVERWORLD)) { for (Block block : GTBedrockOreHandler.getBedrockOreMap().keySet()) { if (GTBedrockOreHandler.shouldGTCHandleGeneration(block)) { GTOreGenerator.generateBedrockVein(block, world, random, chunkX, chunkZ); } } } }
Example #21
Source File: TraverseWorld.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
public static void register(Version versionAdded, Biome biome, BiomeType type, String name, int weight, boolean disabled, boolean canSpawn, RegistryEvent.Register<Biome> event, BiomeDictionary.Type... biomeDictTypes) { register(versionAdded, biome, type, name, weight, disabled, canSpawn, NO_VILLAGES, event, biomeDictTypes); }
Example #22
Source File: WorldGenRubberTree.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { if (world.getWorldType() == WorldType.FLAT || !world.provider.isSurfaceWorld()) { return; //do not generate in flat worlds, or in non-surface worlds } BlockPos randomPos = new BlockPos(chunkX * 16 + 8, 0, chunkZ * 16 + 8); Biome biome = world.getBiome(randomPos); if (BiomeDictionary.hasType(biome, Type.COLD) || BiomeDictionary.hasType(biome, Type.HOT) || BiomeDictionary.hasType(biome, Type.DRY) || BiomeDictionary.hasType(biome, Type.DEAD) || BiomeDictionary.hasType(biome, Type.SPOOKY)) return; //do not generate in inappropriate biomes int rubberTreeChance = 6; if (BiomeDictionary.hasType(biome, Type.SWAMP) || BiomeDictionary.hasType(biome, Type.WET)) rubberTreeChance /= 2; //double chance of spawning in swamp or wet biomes if (random.nextInt(rubberTreeChance) == 0) { randomPos = world.getTopSolidOrLiquidBlock(randomPos).down(); IBlockState solidBlockState = world.getBlockState(randomPos); BlockGregSapling sapling = MetaBlocks.SAPLING; if (solidBlockState.getBlock().canSustainPlant(solidBlockState, world, randomPos, EnumFacing.UP, sapling)) { BlockPos abovePos = randomPos.up(); IBlockState saplingState = sapling.getDefaultState() .withProperty(BlockGregSapling.VARIANT, LogVariant.RUBBER_WOOD); world.setBlockState(abovePos, saplingState); sapling.generateTree(world, abovePos, saplingState, random); } } }
Example #23
Source File: SubmodGnomes.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void registerEntities(IForgeRegistry<EntityEntry> reg) { reg.register(EntityEntryBuilder.create() .name(CommunityGlobals.MOD_ID + "." + "wood_gnome") .entity(EntityGnomeWood.class) .id(new ResourceLocation(CommunityGlobals.MOD_ID, "wood_gnome"), CommunityGlobals.entity_id++) .tracker(80, 3, false) .spawn(EnumCreatureType.CREATURE, 10, 1, 4, BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST)) .egg(0xd3753f, 0x774725) .build()); }
Example #24
Source File: DabSquirrels.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void registerEntities(IForgeRegistry<EntityEntry> reg) { Set<Biome> biomeset = BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST); Biome[] biomes = biomeset.toArray(new Biome[0]); reg.register(EntityEntryBuilder.create() .entity(EntityDabSquirrel.class).egg(0x89806f, 0xb2a489) .name(CommunityGlobals.MOD_ID + ".dabsquirrel") .id(new ResourceLocation(CommunityGlobals.MOD_ID, "dabsquirrel"), CommunityGlobals.entity_id++) .tracker(128, 1, true) .spawn(EnumCreatureType.CREATURE, 12, 1, 3, biomes) .build()); }
Example #25
Source File: BiomeHelper.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
/** * @deprecated since Forestry 3.2. Use canRainOrSnow(BiomeGenBase biomeGenBase) */ @Deprecated public static boolean canRainOrSnow(int biomeID) { return BiomeDictionary.isBiomeRegistered(biomeID) && canRainOrSnow(BiomeGenBase.getBiome(biomeID)); }
Example #26
Source File: SettingsForestTheme.java From minecraft-roguelike with GNU General Public License v3.0 | 4 votes |
public SettingsForestTheme(){ this.id = ID; this.inherit.add(SettingsBase.ID); this.criteria = new SpawnCriteria(); List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>(); biomes.add(BiomeDictionary.Type.FOREST); this.criteria.setBiomeTypes(biomes); this.towerSettings = new TowerSettings(Tower.ROGUE, Theme.getTheme(Theme.TOWER)); for(int i = 0; i < 5; ++i){ LevelSettings level = new LevelSettings(); SecretFactory secrets; DungeonFactory rooms; SegmentGenerator segments; switch(i){ case 0: rooms = new DungeonFactory(); rooms.addRandom(DungeonRoom.CORNER, 8); rooms.addRandom(DungeonRoom.BRICK, 3); rooms.addSingle(DungeonRoom.CAKE); rooms.addSingle(DungeonRoom.DARKHALL); rooms.addSingle(DungeonRoom.LIBRARY); level.setRooms(rooms); secrets = new SecretFactory(); secrets.addRoom(DungeonRoom.SMITH); secrets.addRoom(DungeonRoom.BEDROOM, 2); level.setSecrets(secrets); level.setTheme(Theme.getTheme(Theme.SPRUCE)); segments = new SegmentGenerator(Segment.ARCH); segments.add(Segment.DOOR, 8); segments.add(Segment.LAMP, 2); segments.add(Segment.WHEAT, 3); segments.add(Segment.FLOWERS, 2); segments.add(Segment.INSET, 1); segments.add(Segment.PLANT, 2); segments.add(Segment.SHELF, 1); segments.add(Segment.CHEST, 1); level.setSegments(segments); break; case 1: rooms = new DungeonFactory(); rooms.addSingle(DungeonRoom.MUSIC); rooms.addSingle(DungeonRoom.PIT); rooms.addSingle(DungeonRoom.LAB); rooms.addSingle(DungeonRoom.SLIME, 2); rooms.addRandom(DungeonRoom.CORNER, 10); rooms.addRandom(DungeonRoom.BRICK, 3); level.setRooms(rooms); level.setTheme(Theme.getTheme(Theme.DARKHALL)); segments = new SegmentGenerator(Segment.ARCH); segments.add(Segment.DOOR, 10); segments.add(Segment.FLOWERS, 2); segments.add(Segment.INSET, 2); segments.add(Segment.PLANT, 2); segments.add(Segment.SHELF, 2); segments.add(Segment.CHEST, 1); level.setSegments(segments); break; case 2: break; case 3: break; case 4: break; default: break; } levels.put(i, level); } levels.get(3).addFilter(Filter.VINE); }
Example #27
Source File: SettingsJungleTheme.java From minecraft-roguelike with GNU General Public License v3.0 | 4 votes |
public SettingsJungleTheme(){ this.id = ID; this.inherit.add(SettingsBase.ID); this.criteria = new SpawnCriteria(); List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>(); biomes.add(BiomeDictionary.Type.JUNGLE); this.criteria.setBiomeTypes(biomes); this.towerSettings = new TowerSettings(Tower.JUNGLE, Theme.getTheme(Theme.JUNGLE)); this.lootRules = new LootRuleManager(); for(int i = 0; i < 5; ++i){ this.lootRules.add(null, new WeightedRandomLoot(Items.EMERALD, 0, 1, 1 + i, 1), i, false, 6); this.lootRules.add(null, new WeightedRandomLoot(Items.DIAMOND, 1), i, false, 3 + i * 3); } Theme[] themes = {Theme.JUNGLE, Theme.JUNGLE, Theme.MOSSY, Theme.MOSSY, Theme.NETHER}; SegmentGenerator segments; for(int i = 0; i < 5; ++i){ LevelSettings level = new LevelSettings(); if(i < 4){ level.setDifficulty(3); segments = new SegmentGenerator(Segment.MOSSYARCH); segments.add(Segment.SHELF, 2); segments.add(Segment.INSET, 2); segments.add(Segment.JUNGLE, 5); segments.add(Segment.SKULL, 1); segments.add(Segment.ARROW, 1); segments.add(Segment.CELL, 1); segments.add(Segment.SILVERFISH, 1); segments.add(Segment.CHEST, 1); segments.add(Segment.SPAWNER, 2); level.setSegments(segments); level.addFilter(Filter.VINE); } level.setTheme(Theme.getTheme(themes[i])); levels.put(i, level); } }
Example #28
Source File: SettingsGrasslandTheme.java From minecraft-roguelike with GNU General Public License v3.0 | 4 votes |
public SettingsGrasslandTheme(){ this.id = ID; this.inherit.add(SettingsBase.ID); this.criteria = new SpawnCriteria(); List<BiomeDictionary.Type> biomes = new ArrayList<BiomeDictionary.Type>(); biomes.add(BiomeDictionary.Type.PLAINS); this.criteria.setBiomeTypes(biomes); this.towerSettings = new TowerSettings(Tower.ROGUE, Theme.getTheme(Theme.TOWER)); for(int i = 0; i < 5; ++i){ LevelSettings level = new LevelSettings(); SecretFactory secrets = new SecretFactory(); DungeonFactory rooms = new DungeonFactory(); switch(i){ case 0: secrets.addRoom(DungeonRoom.BEDROOM); secrets.addRoom(DungeonRoom.SMITH); secrets.addRoom(DungeonRoom.FIREWORK); level.setSecrets(secrets); break; case 1: secrets.addRoom(DungeonRoom.BTEAM); rooms.addSingle(DungeonRoom.MUSIC); rooms.addSingle(DungeonRoom.PIT); rooms.addSingle(DungeonRoom.MESS); rooms.addSingle(DungeonRoom.LAB); rooms.addRandom(DungeonRoom.CORNER, 10); rooms.addRandom(DungeonRoom.BRICK, 3); level.setSecrets(secrets); level.setRooms(rooms); break; case 2: break; case 3: break; case 4: break; default: break; } levels.put(i, level); } levels.get(3).addFilter(Filter.VINE); }
Example #29
Source File: SpawnContext.java From minecraft-roguelike with GNU General Public License v3.0 | 4 votes |
@Override public boolean biomeHasType(Type type) { return BiomeDictionary.hasType(info.getBiome(), type); }
Example #30
Source File: SpawnCriteria.java From minecraft-roguelike with GNU General Public License v3.0 | 4 votes |
public void setBiomeTypes(List<BiomeDictionary.Type> biomeTypes){ this.biomeTypes = biomeTypes; this.everywhere = this.biomes.isEmpty() && this.biomeTypes.isEmpty(); }