diff --git a/common/biomesoplenty/api/Biomes.java b/common/biomesoplenty/api/Biomes.java index 796934e4c..f0a7259d9 100644 --- a/common/biomesoplenty/api/Biomes.java +++ b/common/biomesoplenty/api/Biomes.java @@ -51,6 +51,7 @@ public class Biomes public static Optional hotSprings = Optional.absent(); public static Optional icyHills = Optional.absent(); public static Optional jadeCliffs = Optional.absent(); + public static Optional lavenderFields = Optional.absent(); public static Optional lushDesert = Optional.absent(); public static Optional lushSwamp = Optional.absent(); public static Optional mangrove = Optional.absent(); diff --git a/common/biomesoplenty/biomes/BiomeDecoratorBOP.java b/common/biomesoplenty/biomes/BiomeDecoratorBOP.java index 3a576ea0c..789f43bf6 100644 --- a/common/biomesoplenty/biomes/BiomeDecoratorBOP.java +++ b/common/biomesoplenty/biomes/BiomeDecoratorBOP.java @@ -222,6 +222,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator public WorldGenerator hibiscusGen; public WorldGenerator lilyOfTheValleyGen; public WorldGenerator burningBlossomGen; + public WorldGenerator lavenderGen; public WorldGenerator boneSpineGen; public WorldGenerator boneSpine2Gen; @@ -310,6 +311,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator public int hibiscusPerChunk; public int lilyOfTheValleysPerChunk; public int burningBlossomsPerChunk; + public int lavenderPerChunk; public int boneSpinesPerChunk; public int boneSpines2PerChunk; @@ -462,6 +464,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator hibiscusGen = new WorldGenBOPFlowers(Blocks.flowers2.get().blockID, 0); lilyOfTheValleyGen = new WorldGenBOPFlowers(Blocks.flowers2.get().blockID, 1); burningBlossomGen = new WorldGenBOPFlowers(Blocks.flowers2.get().blockID, 2); + lavenderGen = new WorldGenBOPFlowers(Blocks.flowers2.get().blockID, 3); lilyflowerGen = new WorldGenLilyflower(); deathbloomGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 2); hydrangeaGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 4); @@ -590,6 +593,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator hibiscusPerChunk = 0; lilyOfTheValleysPerChunk = 0; burningBlossomsPerChunk = 0; + lavenderPerChunk = 0; generateLakes = true; generateAsh = false; generateMycelium = false; @@ -1134,6 +1138,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator var5 = chunk_Z + randomGenerator.nextInt(16) + 8; burningBlossomGen.generate(currentWorld, randomGenerator, var3, var4, var5); } + + for (var2 = 0; var2 < lavenderPerChunk; ++var2) + { + var3 = chunk_X + randomGenerator.nextInt(16) + 8; + var4 = randomGenerator.nextInt(256); + var5 = chunk_Z + randomGenerator.nextInt(16) + 8; + lavenderGen.generate(currentWorld, randomGenerator, var3, var4, var5); + } for (var2 = 0; var2 < hydrangeasPerChunk; ++var2) { diff --git a/common/biomesoplenty/biomes/BiomeGenLavenderFields.java b/common/biomesoplenty/biomes/BiomeGenLavenderFields.java new file mode 100644 index 000000000..cedb91a67 --- /dev/null +++ b/common/biomesoplenty/biomes/BiomeGenLavenderFields.java @@ -0,0 +1,73 @@ +package biomesoplenty.biomes; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.SpawnListEntry; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.Blocks; +import biomesoplenty.worldgen.tree.WorldGenJacaranda; + +public class BiomeGenLavenderFields extends BiomeGenBase +{ + private BiomeDecoratorBOP customBiomeDecorator; + + public BiomeGenLavenderFields(int par1) + { + super(par1); + theBiomeDecorator = new BiomeDecoratorBOP(this); + customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; + customBiomeDecorator.treesPerChunk = 1; + customBiomeDecorator.flowersPerChunk = -999; + customBiomeDecorator.grassPerChunk = 20; + customBiomeDecorator.lavenderPerChunk = 999; + customBiomeDecorator.generatePumpkins = true; + } + + /** + * Gets a WorldGen appropriate for this biome. + */ + @Override + public WorldGenerator getRandomWorldGenForTrees(Random par1Random) + { + return par1Random.nextInt(3) == 0 ? this.worldGeneratorBigTree : new WorldGenJacaranda(false); + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + @Override + public int getBiomeGrassColor() + { + return 10601325; + } + + @Override + public int getBiomeFoliageColor() + { + return 10601325; + } + + @Override + public void decorate(World par1World, Random par2Random, int par3, int par4) + { + super.decorate(par1World, par2Random, par3, par4); + int var5 = 12 + par2Random.nextInt(6); + + for (int var6 = 0; var6 < var5; ++var6) + { + int var7 = par3 + par2Random.nextInt(16); + int var8 = par2Random.nextInt(28) + 4; + int var9 = par4 + par2Random.nextInt(16); + int var10 = par1World.getBlockId(var7, var8, var9); + + if (var10 == Block.stone.blockID) + { + par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 4, 2); + } + } + } +} diff --git a/common/biomesoplenty/configuration/BOPBiomes.java b/common/biomesoplenty/configuration/BOPBiomes.java index f960e09e2..3016e9bc9 100644 --- a/common/biomesoplenty/configuration/BOPBiomes.java +++ b/common/biomesoplenty/configuration/BOPBiomes.java @@ -49,6 +49,7 @@ import biomesoplenty.biomes.BiomeGenHighland; import biomesoplenty.biomes.BiomeGenHotSprings; import biomesoplenty.biomes.BiomeGenIcyHills; import biomesoplenty.biomes.BiomeGenJadeCliffs; +import biomesoplenty.biomes.BiomeGenLavenderFields; import biomesoplenty.biomes.BiomeGenLushDesert; import biomesoplenty.biomes.BiomeGenLushSwamp; import biomesoplenty.biomes.BiomeGenMangrove; @@ -220,6 +221,7 @@ public class BOPBiomes { Biomes.hotSprings = Optional.of((new BiomeGenHotSprings(BOPConfigurationIDs.hotSpringsID)).setColor(10486015).setBiomeName("Hot Springs").setMinMaxHeight(0.2F, 0.5F).setTemperatureRainfall(0.5F, 0.7F)); Biomes.icyHills = Optional.of((new BiomeGenIcyHills(BOPConfigurationIDs.icyHillsID)).setColor(14090235).setBiomeName("Icy Hills").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).setMinMaxHeight(0.3F, 0.8F)); Biomes.jadeCliffs = Optional.of((new BiomeGenJadeCliffs(BOPConfigurationIDs.jadeCliffsID)).setColor(14090235).setBiomeName("Jade Cliffs").setTemperatureRainfall(0.5F, 0.1F).setMinMaxHeight(0.5F, 1.5F)); + Biomes.lavenderFields = Optional.of((new BiomeGenLavenderFields(BOPConfigurationIDs.lavenderFieldsID)).setColor(9286496).setBiomeName("Lavender Fields").setTemperatureRainfall(0.6F, 0.7F).setMinMaxHeight(0.3F, 0.3F)); Biomes.lushDesert = Optional.of((new BiomeGenLushDesert(BOPConfigurationIDs.lushDesertID)).setColor(16421912).setBiomeName("Lush Desert").setTemperatureRainfall(0.8F, 0.2F).setMinMaxHeight(0.2F, 0.9F)); Biomes.lushSwamp = Optional.of((new BiomeGenLushSwamp(BOPConfigurationIDs.lushSwampID)).setColor(522674).setBiomeName("Lush Swamp").func_76733_a(9154376).setMinMaxHeight(0.2F, 0.3F).setTemperatureRainfall(0.7F, 1.0F)); Biomes.mangrove = Optional.of((new BiomeGenMangrove(BOPConfigurationIDs.mangroveID)).setColor(16440917).setBiomeName("Mangrove").setMinMaxHeight(0.1F, 0.3F).setTemperatureRainfall(0.8F, 0.9F)); @@ -358,6 +360,7 @@ public class BOPBiomes { BiomeDictionary.registerBiomeType(Biomes.hotSprings.get(), Type.HILLS, Type.FOREST, Type.WATER); BiomeDictionary.registerBiomeType(Biomes.icyHills.get(), Type.FROZEN, Type.HILLS); BiomeDictionary.registerBiomeType(Biomes.jadeCliffs.get(), Type.FOREST, Type.MOUNTAIN); + BiomeDictionary.registerBiomeType(Biomes.lavenderFields.get(), Type.PLAINS); BiomeDictionary.registerBiomeType(Biomes.lushDesert.get(), Type.DESERT, Type.FOREST); BiomeDictionary.registerBiomeType(Biomes.lushSwamp.get(), Type.SWAMP, Type.WATER); BiomeDictionary.registerBiomeType(Biomes.mangrove.get(), Type.WATER, Type.FOREST); @@ -482,6 +485,7 @@ public class BOPBiomes { addSpawnBiome(Biomes.heathland); addSpawnBiome(Biomes.highland); addSpawnBiome(Biomes.jadeCliffs); + addSpawnBiome(Biomes.lavenderFields); addSpawnBiome(Biomes.lushDesert); addSpawnBiome(Biomes.lushSwamp); addSpawnBiome(Biomes.mangrove); @@ -600,6 +604,7 @@ public class BOPBiomes { addStrongholdBiome(Biomes.hotSprings); addStrongholdBiome(Biomes.icyHills); addStrongholdBiome(Biomes.jadeCliffs); + addStrongholdBiome(Biomes.lavenderFields); addStrongholdBiome(Biomes.lushDesert); addStrongholdBiome(Biomes.lushSwamp); addStrongholdBiome(Biomes.mangrove); @@ -794,6 +799,10 @@ public class BOPBiomes { if (BOPConfigurationBiomeGen.jadeCliffsGen) { registerBiome(Biomes.jadeCliffs); } + + if (BOPConfigurationBiomeGen.lavenderFieldsGen) { + registerBiome(Biomes.lavenderFields); + } if (BOPConfigurationBiomeGen.lushDesertGen) { registerBiome(Biomes.lushDesert); @@ -1187,6 +1196,10 @@ public class BOPBiomes { if (BOPConfigurationBiomeGen.jadeCliffsGen) { addBiomeToWorldTypes(getWorldTypes(), Biomes.jadeCliffs); } + + if (BOPConfigurationBiomeGen.lavenderFieldsGen) { + addBiomeToWorldTypes(getWorldTypes(), Biomes.lavenderFields); + } if (BOPConfigurationBiomeGen.lushDesertGen) { addBiomeToWorldTypes(getWorldTypes(), Biomes.lushDesert); diff --git a/common/biomesoplenty/configuration/configfile/BOPConfigurationBiomeGen.java b/common/biomesoplenty/configuration/configfile/BOPConfigurationBiomeGen.java index c3ca1accb..7a0e39c84 100644 --- a/common/biomesoplenty/configuration/configfile/BOPConfigurationBiomeGen.java +++ b/common/biomesoplenty/configuration/configfile/BOPConfigurationBiomeGen.java @@ -46,6 +46,7 @@ public class BOPConfigurationBiomeGen public static boolean hotSpringsGen; public static boolean icyHillsGen; public static boolean jadeCliffsGen; + public static boolean lavenderFieldsGen; public static boolean lushDesertGen; public static boolean lushSwampGen; public static boolean mangroveGen; @@ -156,6 +157,7 @@ public class BOPConfigurationBiomeGen hotSpringsGen = config.get("Biomes To Generate", "HotSprings", true).getBoolean(false); icyHillsGen = config.get("Biomes To Generate", "IcyHills", true).getBoolean(false); jadeCliffsGen = config.get("Biomes To Generate", "JadeCliffs", true).getBoolean(false); + lavenderFieldsGen = config.get("Biomes To Generate", "LavenderFields", true).getBoolean(false); lushDesertGen = config.get("Biomes To Generate", "LushDesert", true).getBoolean(false); lushSwampGen = config.get("Biomes To Generate", "LushSwamp", true).getBoolean(false); mangroveGen = config.get("Biomes To Generate", "Mangrove", true).getBoolean(false); diff --git a/common/biomesoplenty/configuration/configfile/BOPConfigurationIDs.java b/common/biomesoplenty/configuration/configfile/BOPConfigurationIDs.java index d90c0c41e..42dd36d2f 100644 --- a/common/biomesoplenty/configuration/configfile/BOPConfigurationIDs.java +++ b/common/biomesoplenty/configuration/configfile/BOPConfigurationIDs.java @@ -198,6 +198,7 @@ public class BOPConfigurationIDs public static int hotSpringsID; public static int icyHillsID; public static int jadeCliffsID; + public static int lavenderFieldsID; public static int lushDesertID; public static int lushSwampID; public static int mangroveID; @@ -471,6 +472,7 @@ public class BOPConfigurationIDs //23-79 ExtraBiomesXL + lavenderFieldsID = config.get("Biome IDs", "Lavender Fields ID", 31).getInt(); tropicsMountainID = config.get("Biome IDs", "Tropics Mountain (Sub-Biome) ID", 32).getInt(); autumnHillsID = config.get("Biome IDs", "Autumn Hills ID", 33).getInt(); overgrownGreensID = config.get("Biome IDs", "Overgrown Greens ID", 34).getInt(); diff --git a/common/biomesoplenty/world/WorldTypeBOP.java b/common/biomesoplenty/world/WorldTypeBOP.java index 00ff49ea9..d078c354b 100644 --- a/common/biomesoplenty/world/WorldTypeBOP.java +++ b/common/biomesoplenty/world/WorldTypeBOP.java @@ -158,6 +158,10 @@ public class WorldTypeBOP extends WorldType { addNewBiome(Biomes.jadeCliffs); } + if (BOPConfigurationBiomeGen.lavenderFieldsGen == true) + { + addNewBiome(Biomes.lavenderFields); + } if (BOPConfigurationBiomeGen.lushDesertGen == true) { addNewBiome(Biomes.lushDesert); diff --git a/resources/assets/biomesoplenty/textures/blocks/lavender.png b/resources/assets/biomesoplenty/textures/blocks/lavender.png index b9679f644..da85dc159 100644 Binary files a/resources/assets/biomesoplenty/textures/blocks/lavender.png and b/resources/assets/biomesoplenty/textures/blocks/lavender.png differ