public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) { if (pos==null) return ImmutableList.of(); if (creatureType == EnumCreatureType.MONSTER) { //if (this.genNetherBridge.isInsideStructure(pos)) { // return this.genNetherBridge.getSpawnList(); //} if (this.genNetherBridge.isPositionInStructure(this.world, pos) && this.world.getBlockState(pos.down()).getBlock() == Blocks.NETHER_BRICK) { return this.genNetherBridge.getSpawnList(); } return Biomes.HELL.getSpawnableList(EnumCreatureType.MONSTER); //TODO: Replace with actual-biome lists. } return ImmutableList.of(); //Biome biome = this.world.getBiome(pos); //return biome.getSpawnableList(creatureType); }
@Override public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { super.updateTick(worldIn, pos, state, rand); if (!worldIn.isRemote) { if (state.getValue(AGE) == 2) { EntityFaerie faerie = new EntityFaerie(worldIn, 4.0D, 0, 0.1F, 1); faerie.setPosition((double) pos.getX(), (double) pos.up().getY(), (double) pos.getZ()); worldIn.spawnEntity(faerie); } if (!(worldIn.getBiome(pos) == Biomes.FOREST || worldIn.getBiome(pos) == Biomes.FOREST_HILLS || worldIn.getBiome(pos) == Biomes.TAIGA || worldIn.getBiome(pos) == Biomes.TAIGA_HILLS) && state.getValue(AGE) >= 1) { worldIn.setBlockState(pos, state.withProperty(AGE, 0)); } } }
@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { if (random.nextInt(20) == 0){ int x = chunkX * 16 + 2 + random.nextInt(12); int z = chunkZ * 16 + 2 + random.nextInt(12); BlockPos p = new BlockPos(x,0,z); p = world.getHeight(p); Biome b = world.getBiome(p); if (BiomeDictionary.hasType(b, BiomeDictionary.Type.FOREST) || b == Biomes.FOREST || b == Biomes.FOREST_HILLS){ if (world.getBlockState(p.down()).getBlock() instanceof BlockGrass && world.isAirBlock(p)){ BlockTeaSapling.generateTree(world, p, Blocks.AIR.getDefaultState(), random); } } } }
public static void init() { int id = 0; EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":withering_bolt"), EntityWitheringBolt.class, "withering_bolt", id++, Infernum.instance, 64, 1, true); EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), EntityPigZombieMage.class, "zombie_pigman_mage", id++, Infernum.instance, 64, 1, true); EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), 14581128, 11799808); EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":pigman_mage"), EntityPigMage.class, "pigman_mage", id++, Infernum.instance, 64, 1, true); EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":pigman_mage"), 14581128, 11665527); EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":fire_breath"), EntityFireBreath.class, "fire_breath", id++, Infernum.instance, 64, 1, true); List<Biome> spawnBiomes = new ArrayList<Biome>(); spawnBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER)); spawnBiomes.add(Biomes.HELL); for (Biome b : spawnBiomes) { System.out.println(b.getBiomeName()); } EntityRegistry.addSpawn(EntityPigZombieMage.class, 150, 1, 2, EnumCreatureType.MONSTER, spawnBiomes.toArray(new Biome[spawnBiomes.size()])); }
public static Anima getFromBiome(Biome biome) { if (BiomeDictionary.hasType(biome, Type.WATER)) return Anima.DEPTH; else if (BiomeDictionary.hasType(biome, Type.FOREST) || BiomeDictionary.hasType(biome, Type.PLAINS)) return Anima.HORIZON; else if (BiomeDictionary.hasType(biome, Type.DRY) || BiomeDictionary.hasType(biome, Type.NETHER) || BiomeDictionary.hasType(biome, Type.HOT)) return Anima.INFERNO; else if (BiomeDictionary.hasType(biome, Type.HILLS) || BiomeDictionary.hasType(biome, Type.MOUNTAIN) || BiomeDictionary.hasType(biome, Type.COLD)) return Anima.OZONE; else if (BiomeDictionary.hasType(biome, Type.MESA)) return Anima.CHAOS; else if (biome.equals(Biomes.MUSHROOM_ISLAND) || biome.equals(Biomes.MUSHROOM_ISLAND_SHORE)) return Anima.PEACE; else return Anima.HORIZON; }
/** * creates a new world chunk manager for WorldProvider */ protected void createBiomeProvider() { this.field_191067_f = true; WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType(); if (worldtype == WorldType.FLAT) { FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions()); this.biomeProvider = new BiomeProviderSingle(Biome.getBiome(flatgeneratorinfo.getBiome(), Biomes.DEFAULT)); } else if (worldtype == WorldType.DEBUG_WORLD) { this.biomeProvider = new BiomeProviderSingle(Biomes.PLAINS); } else { this.biomeProvider = new BiomeProvider(this.worldObj.getWorldInfo()); } }
public Biome getBestBiome(int x, int z) { double weight = Double.MIN_VALUE; BiomeGroup bestGroup = null; Map<BiomeGroup,Double> weights = getBiomeWeights(x,z, this.noise); double w; for (BiomeGroup b : weights.keySet()) { w = weights.get(b); if (w > weight) { bestGroup = b; weight = w; } } if (bestGroup == null) { return Biomes.DEFAULT; } return getSubBiomeForPosition(x,z, bestGroup); }
public Biome getBiome(BlockPos pos, BiomeProvider provider) { int i = pos.getX() & 15; int j = pos.getZ() & 15; int k = this.blockBiomeArray[j << 4 | i] & 255; if (k == 255) { Biome biome = provider.getBiome(pos, Biomes.PLAINS); k = Biome.getIdForBiome(biome); this.blockBiomeArray[j << 4 | i] = (byte)(k & 255); } Biome biome1 = Biome.getBiome(k); return biome1 == null ? Biomes.PLAINS : biome1; }
public Start(BiomeProvider chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List<StructureVillagePieces.PieceWeight> p_i2104_6_, int p_i2104_7_) { super((StructureVillagePieces.Start)null, 0, rand, p_i2104_4_, p_i2104_5_); this.worldChunkMngr = chunkManagerIn; this.structureVillageWeightedPieceList = p_i2104_6_; this.terrainType = p_i2104_7_; Biome biome = chunkManagerIn.getBiome(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.DEFAULT); if (biome instanceof BiomeDesert) { this.structureType = 1; } else if (biome instanceof BiomeSavanna) { this.structureType = 2; } else if (biome instanceof BiomeTaiga) { this.structureType = 3; } this.func_189924_a(this.structureType); this.isZombieInfested = rand.nextInt(50) == 0; }
public Start(BiomeProvider chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List<StructureVillagePieces.PieceWeight> p_i2104_6_, int p_i2104_7_) { super((StructureVillagePieces.Start)null, 0, rand, p_i2104_4_, p_i2104_5_); this.worldChunkMngr = chunkManagerIn; this.structureVillageWeightedPieceList = p_i2104_6_; this.terrainType = p_i2104_7_; Biome biome = chunkManagerIn.getBiome(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.DEFAULT); this.biome = biome; this.startPiece = this; if (biome instanceof BiomeDesert) { this.structureType = 1; } else if (biome instanceof BiomeSavanna) { this.structureType = 2; } else if (biome instanceof BiomeTaiga) { this.structureType = 3; } this.func_189924_a(this.structureType); this.isZombieInfested = rand.nextInt(50) == 0; }
public void coralPassGenerate(World worldIn, Random rand, Biome biome, BlockPos pos) { if (!BiomeDictionary.areSimilar(biome, Biomes.OCEAN)) { return; } int x = rand.nextInt(16) + 8; int z = rand.nextInt(16) + 8; BlockPos at = worldIn.getHeight(pos.add(x, 0, z)); EventGenCoral event = new EventGenCoral(worldIn, at, rand, genCoral); if (MinecraftForge.TERRAIN_GEN_BUS.post(event)) { return; } event.generator.generate(worldIn, rand, at); }
public int modifiedIncidence(Numbered<Biome> biomeIncidence) { Biome biome = biomeIncidence.item(); // increase mountains; if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MOUNTAIN)) { // multiply by 4 return biomeIncidence.count()*4; } // check that extreme hills are a mountain biome if (biomeIncidence.item() == Biomes.EXTREME_HILLS) { return biomeIncidence.count()*4; } // Hills unaffected if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.HILLS)) { // multiply by 4 return biomeIncidence.count(); } // Oceans unaffected if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.OCEAN)) { // multiply by 4 return biomeIncidence.count(); } // everything else suppressed; return 0; }
public int modifiedIncidence(Numbered<Biome> biomeIncidence) { Biome biome = biomeIncidence.item(); // erase mountains; if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MOUNTAIN)) { return 0; } // check that extreme hills are a mountain biome if (biomeIncidence.item() == Biomes.EXTREME_HILLS) { return 0; } // Hills unaffected if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.HILLS)) { return biomeIncidence.count(); } // Oceans unaffected if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.OCEAN)) { return biomeIncidence.count(); } // everything else increased slightly; return (biomeIncidence.count()*4)/3; }
/** * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall * amounts, or biomeList[] indices based on the particular GenLayer subclass. */ public int[] getInts(int par1, int par2, int par3, int par4) { int[] aint = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2); int[] aint1 = IntCache.getIntCache(par3 * par4); for (int i1 = 0; i1 < par4; ++i1) { for (int j1 = 0; j1 < par3; ++j1) { this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2)); int k1 = aint[j1 + 1 + (i1 + 1) * (par3 + 2)]; if ((k1 != Biome.getIdForBiome(Biomes.SWAMPLAND) || this.nextInt(6) != 0) && (k1 != Biome.getIdForBiome(Biomes.JUNGLE) && k1 != Biome.getIdForBiome(Biomes.JUNGLE_HILLS) || this.nextInt(8) != 0)) { aint1[j1 + i1 * par3] = k1; } else { aint1[j1 + i1 * par3] = Biome.getIdForBiome(Biomes.RIVER); } } } return aint1; }
/** * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall * amounts, or biomeList[] indices based on the particular GenLayer subclass. */ public int[] getInts(int par1, int par2, int par3, int par4){ int i1 = par1 ; int j1 = par2 ; int parentSpan = par3; int l1 = par4; int[] aint = this.parent.getInts(i1, j1, parentSpan, l1); // not sure what's x and z but I need readable variable names for (int z = 0; z < par4; z++) { for (int x = 0; x < par3; x++) { int center = aint[x + (z) * parentSpan]; //logger.info("at "+(x + (z) * parentSpan)+", "+center); if (center == Biome.getIdForBiome(Biomes.PLAINS)) throw new RuntimeException("at "+(x + (z) * parentSpan)); } } return aint; }
@SubscribeEvent(priority = EventPriority.LOWEST) public void decorate(DecorateBiomeEvent.Decorate event) { World world = event.getWorld(); Biome biome = world.getBiomeGenForCoords(event.getPos()); Random rand = event.getRand(); if ((biome == Biomes.PLAINS || biome == Biomes.ICE_PLAINS || biome == Biomes.MUTATED_PLAINS || biome == Biomes.EXTREME_HILLS_WITH_TREES || biome == Biomes.MUTATED_EXTREME_HILLS_WITH_TREES) && event.getType() == DecorateBiomeEvent.Decorate.EventType.TREE) { if (rand.nextDouble() > 0.1) return; int x = rand.nextInt(16) + 8; int y = rand.nextInt(16) + 8; TintedTreeGenerator gen = new TintedTreeGenerator(); gen.generateTree(rand, world, world.getHeight(event.getPos().add(x, 0, y))); event.setResult(Event.Result.DENY); } }
@Override public Chunk generateChunk(int x, int z) { Chunk c = new Chunk(w, new ChunkPrimer(), x, z); Biome[] abiome = this.w.getBiomeProvider().getBiomesForGeneration((Biome[]) null, x * 16, z * 16, 16, 16); byte[] ids = c.getBiomeArray(); for (int i = 0; i < ids.length; ++i) { if (Config.voidBiomeNether) ids[i] = (byte) Biome.getIdForBiome(Biomes.VOID); else //ids[i] = (byte) Biome.getIdForBiome(abiome[i]); ids[i] = (byte) Biome.getIdForBiome(Biomes.HELL); } c.generateSkylightMap(); return c; }
@Override public Chunk generateChunk(int x, int z) { Chunk c = new Chunk(w, new ChunkPrimer(), x, z); Biome[] abiome = this.w.getBiomeProvider().getBiomesForGeneration((Biome[]) null, x * 16, z * 16, 16, 16); byte[] ids = c.getBiomeArray(); for (int i = 0; i < ids.length; ++i) { if (Config.voidBiomeOverworld) ids[i] = (byte) Biome.getIdForBiome(Biomes.VOID); else ids[i] = (byte) Biome.getIdForBiome(abiome[i]); } c.generateSkylightMap(); return c; }
@Override public Chunk generateChunk(int x, int z) { Chunk c = new Chunk(w, new ChunkPrimer(), x, z); Biome[] abiome = this.w.getBiomeProvider().getBiomesForGeneration((Biome[]) null, x * 16, z * 16, 16, 16); byte[] ids = c.getBiomeArray(); for (int i = 0; i < ids.length; ++i) { if (Config.voidBiomeEnd) ids[i] = (byte) Biome.getIdForBiome(Biomes.VOID); else ids[i] = (byte) Biome.getIdForBiome(abiome[i]); } c.generateSkylightMap(); return c; }
private void run(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) { if (minHeight < 0 || maxHeight > Const.WORLDHEIGHT || minHeight > maxHeight) throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); int heightDiff = maxHeight - minHeight; BlockPos pos; Biome biome; for (int i = 0; i < chancesToSpawn; i++) { int x = chunk_X + rand.nextInt(Const.CHUNK_SIZE); int y = minHeight + rand.nextInt(heightDiff); int z = chunk_Z + rand.nextInt(Const.CHUNK_SIZE); pos = new BlockPos(x, y, z); biome = world.getBiome(pos); if (biome == Biomes.RIVER || biome == Biomes.FROZEN_RIVER) { generator.generate(world, rand, pos); } } }
private void run(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) { if (minHeight < 0 || maxHeight > Const.WORLDHEIGHT || minHeight > maxHeight) throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); int heightDiff = maxHeight - minHeight; BlockPos pos; Biome biome; for (int i = 0; i < chancesToSpawn; i++) { int x = chunk_X + rand.nextInt(Const.CHUNK_SIZE); int y = minHeight + rand.nextInt(heightDiff); int z = chunk_Z + rand.nextInt(Const.CHUNK_SIZE); pos = new BlockPos(x, y, z); biome = world.getBiome(pos); if (biome == Biomes.EXTREME_HILLS || biome == Biomes.EXTREME_HILLS_EDGE || biome == Biomes.EXTREME_HILLS_WITH_TREES) { generator.generate(world, rand, pos); } } }
DragonBreedNether() { super("nether", 0x793838); addImmunity(DamageSource.inFire); addImmunity(DamageSource.onFire); addImmunity(DamageSource.lava); addHabitatBlock(Blocks.NETHERRACK); addHabitatBlock(Blocks.SOUL_SAND); addHabitatBlock(Blocks.NETHER_BRICK); addHabitatBlock(Blocks.NETHER_BRICK_FENCE); addHabitatBlock(Blocks.NETHER_BRICK_STAIRS); addHabitatBlock(Blocks.NETHER_WART); addHabitatBlock(Blocks.GLOWSTONE); addHabitatBlock(Blocks.QUARTZ_ORE); addHabitatBiome(Biomes.HELL); }
DragonBreedForest() { super("forest", 0x2d6e00); addHabitatBlock(Blocks.LOG); addHabitatBlock(Blocks.LOG2); addHabitatBlock(Blocks.LEAVES); addHabitatBlock(Blocks.LEAVES2); addHabitatBlock(Blocks.YELLOW_FLOWER); addHabitatBlock(Blocks.RED_FLOWER); addHabitatBlock(Blocks.MOSSY_COBBLESTONE); addHabitatBlock(Blocks.VINE); addHabitatBlock(Blocks.SAPLING); addHabitatBiome(Biomes.FOREST); addHabitatBiome(Biomes.FOREST_HILLS); addHabitatBiome(Biomes.JUNGLE); addHabitatBiome(Biomes.JUNGLE_HILLS); }
public static void init() { int endermanEggColor1 = new Color(254, 85, 176).getRGB(); int endermanEggColor2 = new Color(97, 230, 150).getRGB(); EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "enderman_evolved"), EntityEvolvedEnderman.class, "evolved_enderman", 0, EndermanEvolution.INSTANCE, 80, 3, false, 0, endermanEggColor2); EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "frienderman"), EntityFrienderman.class, "frienderman", 1, EndermanEvolution.INSTANCE, 80, 3, false, 0, endermanEggColor1); EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "friender_pearl"), EntityFrienderPearl.class, "friender_pearl", 2, EndermanEvolution.INSTANCE, 80, 3, true); EntityRegistry.registerModEntity(new ResourceLocation(ModGlobals.MODID, "evolved_endermite"), EntityEvolvedEndermite.class, "evolved_endermite", 4, EndermanEvolution.INSTANCE, 80, 3, false, new Color(1, 66, 16).getRGB(), endermanEggColor2); EntitySpawnPlacementRegistry.setPlacementType(EntityEvolvedEnderman.class, SpawnPlacementType.ON_GROUND); EntitySpawnPlacementRegistry.setPlacementType(EntityFrienderman.class, SpawnPlacementType.ON_GROUND); EntityRegistry.addSpawn(EntityEvolvedEnderman.class, ConfigOptions.ENDERMAN_PROBABILITY, 1, ConfigOptions.ENDERMAN_MAX_SPAWN, EnumCreatureType.MONSTER, getBiomeList()); EntityRegistry.addSpawn(EntityFrienderman.class, ConfigOptions.FRIENDERMAN_PROBABILITY, 1, ConfigOptions.FRIENDERMAN_MAX_SPAWN, EnumCreatureType.CREATURE, Biomes.SKY, Biomes.DESERT, Biomes.HELL); }
/** * Returns an array of biomes for the location input. */ public Biome[] getBiomesForGeneration(Biome[] biomes, int x, int z, int width, int height) { IntCache.resetIntCache(); if (biomes == null || biomes.length < width * height) { biomes = new Biome[width * height]; } int[] aint = this.genBiomes.getInts(x, z, width, height); try { for (int i = 0; i < width * height; ++i) { biomes[i] = Biome.getBiome(aint[i], Biomes.DEFAULT); } return biomes; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock"); crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(biomes.length)); crashreportcategory.addCrashSection("x", Integer.valueOf(x)); crashreportcategory.addCrashSection("z", Integer.valueOf(z)); crashreportcategory.addCrashSection("w", Integer.valueOf(width)); crashreportcategory.addCrashSection("h", Integer.valueOf(height)); throw new ReportedException(crashreport); } }
/** * Gets a list of biomes for the specified blocks. */ public Biome[] getBiomes(@Nullable Biome[] listToReuse, int x, int z, int width, int length, boolean cacheFlag) { IntCache.resetIntCache(); if (listToReuse == null || listToReuse.length < width * length) { listToReuse = new Biome[width * length]; } if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (z & 15) == 0) { Biome[] abiome = this.biomeCache.getCachedBiomes(x, z); System.arraycopy(abiome, 0, listToReuse, 0, width * length); return listToReuse; } else { int[] aint = this.biomeIndexLayer.getInts(x, z, width, length); for (int i = 0; i < width * length; ++i) { listToReuse[i] = Biome.getBiome(aint[i], Biomes.DEFAULT); } return listToReuse; } }
/** * creates a new world chunk manager for WorldProvider */ public void createBiomeProvider() { this.biomeProvider = new BiomeProviderSingle(Biomes.SKY); NBTTagCompound nbttagcompound = this.worldObj.getWorldInfo().getDimensionData(DimensionType.THE_END); this.dragonFightManager = this.worldObj instanceof WorldServer ? new DragonFightManager((WorldServer)this.worldObj, nbttagcompound.getCompoundTag("DragonFight")) : null; }
public Start(World worldIn, Random random, int chunkX, int chunkZ, Biome biomeIn) { super(chunkX, chunkZ); if (biomeIn != Biomes.JUNGLE && biomeIn != Biomes.JUNGLE_HILLS) { if (biomeIn == Biomes.SWAMPLAND) { ComponentScatteredFeaturePieces.SwampHut componentscatteredfeaturepieces$swamphut = new ComponentScatteredFeaturePieces.SwampHut(random, chunkX * 16, chunkZ * 16); this.components.add(componentscatteredfeaturepieces$swamphut); } else if (biomeIn != Biomes.DESERT && biomeIn != Biomes.DESERT_HILLS) { if (biomeIn == Biomes.ICE_PLAINS || biomeIn == Biomes.COLD_TAIGA) { ComponentScatteredFeaturePieces.Igloo componentscatteredfeaturepieces$igloo = new ComponentScatteredFeaturePieces.Igloo(random, chunkX * 16, chunkZ * 16); this.components.add(componentscatteredfeaturepieces$igloo); } } else { ComponentScatteredFeaturePieces.DesertPyramid componentscatteredfeaturepieces$desertpyramid = new ComponentScatteredFeaturePieces.DesertPyramid(random, chunkX * 16, chunkZ * 16); this.components.add(componentscatteredfeaturepieces$desertpyramid); } } else { ComponentScatteredFeaturePieces.JunglePyramid componentscatteredfeaturepieces$junglepyramid = new ComponentScatteredFeaturePieces.JunglePyramid(random, chunkX * 16, chunkZ * 16); this.components.add(componentscatteredfeaturepieces$junglepyramid); } this.updateBoundingBox(); }
public static FlatGeneratorInfo getDefaultFlatGenerator() { FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); flatgeneratorinfo.setBiome(Biome.getIdForBiome(Biomes.PLAINS)); flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(1, Blocks.BEDROCK)); flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(2, Blocks.DIRT)); flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(1, Blocks.GRASS)); flatgeneratorinfo.updateLayers(); flatgeneratorinfo.getWorldFeatures().put("village", Maps.<String, String>newHashMap()); return flatgeneratorinfo; }
protected static boolean biomesEqualOrMesaPlateau(int biomeIDA, int biomeIDB) { if (biomeIDA == biomeIDB) { return true; } else { Biome biome = Biome.getBiome(biomeIDA); Biome biome1 = Biome.getBiome(biomeIDB); return biome != null && biome1 != null ? (biome != Biomes.MESA_ROCK && biome != Biomes.MESA_CLEAR_ROCK ? biome == biome1 || biome.getBiomeClass() == biome1.getBiomeClass() : biome1 == Biomes.MESA_ROCK || biome1 == Biomes.MESA_CLEAR_ROCK) : false; } }
/** * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall * amounts, or biomeList[] indices based on the particular GenLayer subclass. */ public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) { int i = areaX - 1; int j = areaY - 1; int k = areaWidth + 2; int l = areaHeight + 2; int[] aint = this.parent.getInts(i, j, k, l); int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); for (int i1 = 0; i1 < areaHeight; ++i1) { for (int j1 = 0; j1 < areaWidth; ++j1) { int k1 = aint[j1 + 0 + (i1 + 0) * k]; int l1 = aint[j1 + 2 + (i1 + 0) * k]; int i2 = aint[j1 + 0 + (i1 + 2) * k]; int j2 = aint[j1 + 2 + (i1 + 2) * k]; int k2 = aint[j1 + 1 + (i1 + 1) * k]; this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && this.nextInt(100) == 0) { aint1[j1 + i1 * areaWidth] = Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND); } else { aint1[j1 + i1 * areaWidth] = k2; } } } return aint1; }
/** * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall * amounts, or biomeList[] indices based on the particular GenLayer subclass. */ public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) { int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); for (int i = 0; i < areaHeight; ++i) { for (int j = 0; j < areaWidth; ++j) { this.initChunkSeed((long)(j + areaX), (long)(i + areaY)); int k = aint[j + 1 + (i + 1) * (areaWidth + 2)]; if (this.nextInt(57) == 0) { if (k == Biome.getIdForBiome(Biomes.PLAINS)) { aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MUTATED_PLAINS); } else { aint1[j + i * areaWidth] = k; } } else { aint1[j + i * areaWidth] = k; } } } return aint1; }
/** * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall * amounts, or biomeList[] indices based on the particular GenLayer subclass. */ public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) { int[] aint = this.biomePatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight); int[] aint1 = this.riverPatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight); int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); for (int i = 0; i < areaWidth * areaHeight; ++i) { if (aint[i] != Biome.getIdForBiome(Biomes.OCEAN) && aint[i] != Biome.getIdForBiome(Biomes.DEEP_OCEAN)) { if (aint1[i] == Biome.getIdForBiome(Biomes.RIVER)) { if (aint[i] == Biome.getIdForBiome(Biomes.ICE_PLAINS)) { aint2[i] = Biome.getIdForBiome(Biomes.FROZEN_RIVER); } else if (aint[i] != Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND) && aint[i] != Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE)) { aint2[i] = aint1[i] & 255; } else { aint2[i] = Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND_SHORE); } } else { aint2[i] = aint[i]; } } else { aint2[i] = aint[i]; } } return aint2; }
public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, ChunkProviderSettings p_i45560_5_) { super(p_i45560_1_); this.parent = p_i45560_3_; if (p_i45560_4_ == WorldType.DEFAULT_1_1) { this.warmBiomes = new Biome[] {Biomes.DESERT, Biomes.FOREST, Biomes.EXTREME_HILLS, Biomes.SWAMPLAND, Biomes.PLAINS, Biomes.TAIGA}; this.settings = null; } else { this.settings = p_i45560_5_; } }
/** * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall * amounts, or biomeList[] indices based on the particular GenLayer subclass. */ public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) { int i = areaX - 1; int j = areaY - 1; int k = areaWidth + 2; int l = areaHeight + 2; int[] aint = this.parent.getInts(i, j, k, l); int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); for (int i1 = 0; i1 < areaHeight; ++i1) { for (int j1 = 0; j1 < areaWidth; ++j1) { int k1 = this.riverFilter(aint[j1 + 0 + (i1 + 1) * k]); int l1 = this.riverFilter(aint[j1 + 2 + (i1 + 1) * k]); int i2 = this.riverFilter(aint[j1 + 1 + (i1 + 0) * k]); int j2 = this.riverFilter(aint[j1 + 1 + (i1 + 2) * k]); int k2 = this.riverFilter(aint[j1 + 1 + (i1 + 1) * k]); if (k2 == k1 && k2 == i2 && k2 == l1 && k2 == j2) { aint1[j1 + i1 * areaWidth] = -1; } else { aint1[j1 + i1 * areaWidth] = Biome.getIdForBiome(Biomes.RIVER); } } } return aint1; }
/** * creates a new world chunk manager for WorldProvider */ public void createBiomeProvider() { this.biomeProvider = new BiomeProviderSingle(Biomes.HELL); this.isHellWorld = true; this.hasNoSky = true; }
public Biome getBiome(final BlockPos pos) { if (this.isBlockLoaded(pos)) { Chunk chunk = this.getChunkFromBlockCoords(pos); try { return chunk.getBiome(pos, this.provider.getBiomeProvider()); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting biome"); CrashReportCategory crashreportcategory = crashreport.makeCategory("Coordinates of biome request"); crashreportcategory.setDetail("Location", new ICrashReportDetail<String>() { public String call() throws Exception { return CrashReportCategory.getCoordinateInfo(pos); } }); throw new ReportedException(crashreport); } } else { return this.provider.getBiomeProvider().getBiome(pos, Biomes.PLAINS); } }
/** * Checks if the entity's current position is a valid location to spawn this entity. */ public boolean getCanSpawnHere() { BlockPos blockpos = new BlockPos(MathHelper.floor(this.posX), 0, MathHelper.floor(this.posZ)); Chunk chunk = this.world.getChunkFromBlockCoords(blockpos); if (this.world.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1) { return false; } else { if (this.world.getDifficulty() != EnumDifficulty.PEACEFUL) { Biome biome = this.world.getBiome(blockpos); if (biome == Biomes.SWAMPLAND && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < this.world.getCurrentMoonPhaseFactor() && this.world.getLightFromNeighbors(new BlockPos(this)) <= this.rand.nextInt(8)) { return super.getCanSpawnHere(); } if (this.rand.nextInt(10) == 0 && chunk.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D) { return super.getCanSpawnHere(); } } return false; } }