diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index ed6efb10d..3626a6ba4 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -71,6 +71,7 @@ public class BOPBiomes public static Optional steppe = Optional.absent(); public static Optional temperate_rainforest = Optional.absent(); public static Optional thicket = Optional.absent(); + public static Optional tropical_rainforest = Optional.absent(); public static Optional tundra = Optional.absent(); public static Optional wasteland = Optional.absent(); public static Optional wetland = Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java index f662fa8de..f28fd03f0 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java @@ -35,6 +35,8 @@ public class BiomeGenAlps extends BOPBiome this.topBlock = Blocks.snow.getDefaultState(); this.fillerBlock = Blocks.snow.getDefaultState(); + + this.spawnableCreatureList.clear(); // gem this.addGenerator("emeralds", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(Blocks.emerald_ore.getDefaultState()).create()); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenBambooForest.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenBambooForest.java index 8d36a25df..a94dd9b74 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenBambooForest.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenBambooForest.java @@ -62,6 +62,7 @@ public class BiomeGenBambooForest extends BOPBiome this.addWeight(BOPClimates.TROPICAL, 3); + this.spawnableCreatureList.clear(); this.spawnableCreatureList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1)); this.topBlock = Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenBog.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenBog.java index 476e12f42..41169718c 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenBog.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenBog.java @@ -57,7 +57,6 @@ public class BiomeGenBog extends BOPBiome this.addWeight(BOPClimates.COLD_SWAMP, 7); - this.spawnableCreatureList.clear(); this.spawnableWaterCreatureList.clear(); this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3)); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenChaparral.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenChaparral.java index 3aa2b0280..8c9930112 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenChaparral.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenChaparral.java @@ -40,8 +40,7 @@ public class BiomeGenChaparral extends BOPBiome this.setTemperatureRainfall(0.8F, 0.6F); this.addWeight(BOPClimates.MEDITERANEAN, 10); - - this.spawnableCreatureList.clear(); // none of your regular farmyard critters here + this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 1, 2, 6)); // stone patches diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenDeciduousForest.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenDeciduousForest.java index caaaa1896..7c56463ef 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenDeciduousForest.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenDeciduousForest.java @@ -29,7 +29,7 @@ public class BiomeGenDeciduousForest extends BOPBiome this.setColor(0xC1B749); this.setTemperatureRainfall(0.6F, 0.8F); - this.addWeight(BOPClimates.WARM_TEMPERATE, 10); + this.addWeight(BOPClimates.COOL_TEMPERATE, 7); this.canGenerateVillages = false; diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenHeathland.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenHeathland.java index 000016740..17c96600c 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenHeathland.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenHeathland.java @@ -52,7 +52,6 @@ public class BiomeGenHeathland extends BOPBiome this.addWeight(BOPClimates.MEDITERANEAN, 10); this.addWeight(BOPClimates.DRY_TEMPERATE, 5); - this.spawnableCreatureList.clear(); // none of your regular farmyard critters here // TODO: why is there SO many horses? this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 1, 2, 6)); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLandOfLakes.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLandOfLakes.java index 0eb579e71..4d7c57740 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLandOfLakes.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLandOfLakes.java @@ -62,9 +62,7 @@ public class BiomeGenLandOfLakes extends BOPBiome this.addWeight(BOPClimates.WET_TEMPERATE, 3); this.addWeight(BOPClimates.COOL_TEMPERATE, 3); - this.spawnableCreatureList.clear(); // none of your regular farmyard critters here - this.spawnableWaterCreatureList.clear(); - this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3)); + this.spawnableWaterCreatureList.clear(); // gravel this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(Blocks.gravel.getDefaultState()).create()); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLushDesert.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLushDesert.java index bebf1b967..fd307edcd 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLushDesert.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenLushDesert.java @@ -52,8 +52,6 @@ public class BiomeGenLushDesert extends BOPBiome this.addWeight(BOPClimates.HOT_DESERT, 5); - this.spawnableCreatureList.clear(); - // trees IBlockPosQuery emptyHardenedClay = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create(); GeneratorWeighted treeGenerator = new GeneratorWeighted(3); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMoor.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMoor.java index 6d9bcebf4..1d7ef1e15 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMoor.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMoor.java @@ -47,7 +47,6 @@ public class BiomeGenMoor extends BOPBiome this.addWeight(BOPClimates.COLD_SWAMP, 7); - this.spawnableCreatureList.clear(); this.spawnableWaterCreatureList.clear(); // mud diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenQuagmire.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenQuagmire.java index 3ef7c91c0..d7b6ed4fa 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenQuagmire.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenQuagmire.java @@ -52,6 +52,7 @@ public class BiomeGenQuagmire extends BOPBiome this.addWeight(BOPClimates.COLD_SWAMP, 2); + this.spawnableCreatureList.clear(); this.spawnableWaterCreatureList.clear(); this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3)); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenTropicalRainforest.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenTropicalRainforest.java new file mode 100644 index 000000000..550af435a --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenTropicalRainforest.java @@ -0,0 +1,132 @@ +package biomesoplenty.common.biome.overworld; + +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; +import biomesoplenty.api.biome.BOPBiome; +import biomesoplenty.api.biome.generation.GeneratorStage; +import biomesoplenty.api.biome.generation.GeneratorWeighted; +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.common.block.BlockBOPCoral; +import biomesoplenty.common.block.BlockBOPDoublePlant; +import biomesoplenty.common.block.BlockBOPLilypad; +import biomesoplenty.common.block.BlockBOPMushroom; +import biomesoplenty.common.block.BlockBOPSand; +import biomesoplenty.common.enums.BOPClimates; +import biomesoplenty.common.enums.BOPFlowers; +import biomesoplenty.common.enums.BOPGems; +import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.enums.BOPTrees; +import biomesoplenty.common.enums.BOPWoods; +import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod; +import biomesoplenty.common.world.BOPWorldSettings; +import biomesoplenty.common.world.feature.GeneratorDoubleFlora; +import biomesoplenty.common.world.feature.GeneratorFlora; +import biomesoplenty.common.world.feature.GeneratorGrass; +import biomesoplenty.common.world.feature.GeneratorOreSingle; +import biomesoplenty.common.world.feature.GeneratorSplotches; +import biomesoplenty.common.world.feature.tree.GeneratorBasicTree; + +public class BiomeGenTropicalRainforest extends BOPBiome +{ + + public BiomeGenTropicalRainforest() + { + + // terrain + this.terrainSettings.avgHeight(67).heightVariation(10, 25); + + this.setColor(0x88E140); + this.setTemperatureRainfall(1.2F, 1.0F); + this.skyColor = 0xC8CC5F; + this.waterColorMultiplier = 0x5DFF00; + + this.canGenerateVillages = false; + + this.addWeight(BOPClimates.TROPICAL, 7); + + this.spawnableCreatureList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1)); + + // quicksand + this.addGenerator("quicksand_patches", GeneratorStage.SAND, (new GeneratorSplotches.Builder()).amountPerChunk(0.6F).splotchSize(16).with(BOPBlocks.sand.getDefaultState().withProperty(BlockBOPSand.VARIANT, BlockBOPSand.SandType.QUICKSAND)).splotchSize(20).scatterYMethod(ScatterYMethod.AT_SURFACE).create()); + + // trees + GeneratorWeighted treeGenerator = new GeneratorWeighted(15.0F); + this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); + treeGenerator.add("mahogany", 6, (new GeneratorBasicTree.Builder()).log(BOPWoods.MAHOGANY).leaves(BOPTrees.MAHOGANY).minLeavesRadius(2).minHeight(10).maxHeight(15).create()); + treeGenerator.add("jungle", 2, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.JUNGLE).leaves(BlockPlanks.EnumType.JUNGLE).minHeight(8).maxHeight(12).vine(Blocks.vine.getDefaultState()).create()); + + // flowers + GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.5F); + this.addGenerator("flowers", GeneratorStage.GRASS, flowerGenerator); + flowerGenerator.add("orange_cosmos", 4, (new GeneratorFlora.Builder().with(BOPFlowers.ORANGE_COSMOS).create())); + + // other plants + this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.SHRUB).create()); + this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.LEAFPILE).generationAttempts(64).create()); + this.addGenerator("poison_ivy", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.POISONIVY).create()); + this.addGenerator("double_fern", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.2F).with(BlockDoublePlant.EnumPlantType.FERN).create()); + this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).with(BOPPlants.SPROUT).create()); + + // shrooms + this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(Blocks.brown_mushroom.getDefaultState()).create()); + this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(Blocks.red_mushroom.getDefaultState()).create()); + + // water plants + this.addGenerator("duckweed", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1.0F).with(BlockBOPLilypad.LilypadType.DUCKWEED).generationAttempts(32).create()); + this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(Blocks.waterlily.getDefaultState()).create()); + this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BlockBOPLilypad.LilypadType.MEDIUM).create()); + this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.SMALL).create()); + this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.TINY).create()); + this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(3.0F).replace(Blocks.water).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create()); + + // grasses + GeneratorWeighted grassGenerator = new GeneratorWeighted(10.0F); + this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator); + grassGenerator.add("tallgrass", 5, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).generationAttempts(128).create()); + grassGenerator.add("mediumgrass", 5, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).generationAttempts(128).create()); + grassGenerator.add("wheatgrass", 5, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).generationAttempts(128).create()); + grassGenerator.add("dampgrass", 5, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).generationAttempts(128).create()); + grassGenerator.add("fern", 3, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.FERN).create()); + + // gem + this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create()); + + } + + @Override + public void applySettings(BOPWorldSettings settings) + { + if (!settings.generateBopGems) {this.removeGenerator("topaz");} + } + + @Override + public int getGrassColorAtPos(BlockPos pos) + { + double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + return noise < -0.1D ? 11002176 : 12836929; + } + + @Override + public int getFoliageColorAtPos(BlockPos pos) + { + double noise = GRASS_COLOR_NOISE.func_151601_a((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + return noise < -0.1D ? 8970560 : 10870849; + } + + // TODO: These 2 are copied from 1.7 - but are they used ever? + public int getFogColour(BlockPos pos) + { + return 0x4AD670; + } + + public float getFogDensity(BlockPos pos) + { + return 0.145F; + } + +} diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index bbd9d4774..8ce0c39be 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -77,6 +77,7 @@ import static biomesoplenty.api.biome.BOPBiomes.swampland_extension; import static biomesoplenty.api.biome.BOPBiomes.taiga_extension; import static biomesoplenty.api.biome.BOPBiomes.temperate_rainforest; import static biomesoplenty.api.biome.BOPBiomes.thicket; +import static biomesoplenty.api.biome.BOPBiomes.tropical_rainforest; import static biomesoplenty.api.biome.BOPBiomes.tundra; import static biomesoplenty.api.biome.BOPBiomes.wasteland; import static biomesoplenty.api.biome.BOPBiomes.wetland; @@ -153,6 +154,7 @@ import biomesoplenty.common.biome.overworld.BiomeGenSnowyConiferousForest; import biomesoplenty.common.biome.overworld.BiomeGenSteppe; import biomesoplenty.common.biome.overworld.BiomeGenTemperateRainforest; import biomesoplenty.common.biome.overworld.BiomeGenThicket; +import biomesoplenty.common.biome.overworld.BiomeGenTropicalRainforest; import biomesoplenty.common.biome.overworld.BiomeGenTundra; import biomesoplenty.common.biome.overworld.BiomeGenWasteland; import biomesoplenty.common.biome.overworld.BiomeGenWetland; @@ -382,6 +384,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry steppe = registerBOPBiome(new BiomeGenSteppe(), "Steppe"); temperate_rainforest = registerBOPBiome(new BiomeGenTemperateRainforest(), "Temperate Rainforest"); thicket = registerBOPBiome(new BiomeGenThicket(), "Thicket"); + tropical_rainforest = registerBOPBiome(new BiomeGenTropicalRainforest(), "Tropical Rainforest"); tundra = registerBOPBiome(new BiomeGenTundra(), "Tundra"); wetland = registerBOPBiome(new BiomeGenWetland(), "Wetland"); wasteland = registerBOPBiome(new BiomeGenWasteland(), "Wasteland"); @@ -457,6 +460,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry registerBiomeToDictionary(BOPBiomes.steppe, Type.PLAINS, Type.SANDY, Type.DRY, Type.HOT, Type.SAVANNA, Type.SPARSE, Type.DEAD); registerBiomeToDictionary(BOPBiomes.temperate_rainforest, Type.FOREST, Type.WET, Type.DENSE, Type.LUSH); registerBiomeToDictionary(BOPBiomes.thicket, Type.PLAINS, Type.FOREST, Type.DRY, Type.DEAD, Type.DENSE); + registerBiomeToDictionary(BOPBiomes.tropical_rainforest, Type.JUNGLE, Type.LUSH, Type.HOT, Type.WET); registerBiomeToDictionary(BOPBiomes.tundra, Type.COLD, Type.WASTELAND, Type.DRY, Type.DEAD, Type.SPARSE); registerBiomeToDictionary(BOPBiomes.wasteland, Type.WASTELAND, Type.DEAD, Type.SPARSE, Type.DRY); registerBiomeToDictionary(BOPBiomes.wetland, Type.SWAMP, Type.FOREST, Type.WET, Type.LUSH);