From 1574222eeb8f2a10b2471f402acf7eb000879349 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sun, 12 Jan 2014 16:14:14 +1100 Subject: [PATCH] Readded the Wasteland. All main biomes readded. Have fun Forstride >:) --- .../common/biomes/BiomeGenWasteland.java | 34 +-- .../biomesoplenty/common/core/BOPBiomes.java | 3 +- .../world/decoration/BOPWorldFeatures.java | 4 + .../world/features/WorldGenWasteland.java | 152 ++++++++++++++ .../world/features/WorldGenWasteland2.java | 194 ++++++++++++++++++ .../world/features/WorldGenWasteland3.java | 87 ++++++++ .../world/features/WorldGenWasteland4.java | 83 ++++++++ .../generation/WorldGenFieldAssociation.java | 10 +- 8 files changed, 552 insertions(+), 15 deletions(-) create mode 100644 src/main/java/biomesoplenty/common/world/features/WorldGenWasteland.java create mode 100644 src/main/java/biomesoplenty/common/world/features/WorldGenWasteland2.java create mode 100644 src/main/java/biomesoplenty/common/world/features/WorldGenWasteland3.java create mode 100644 src/main/java/biomesoplenty/common/world/features/WorldGenWasteland4.java diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenWasteland.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenWasteland.java index 24ba3c3b0..1bbe78ad3 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenWasteland.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenWasteland.java @@ -1,20 +1,32 @@ package biomesoplenty.common.biomes; import java.util.HashMap; +import java.util.Random; import net.minecraft.init.Blocks; +import net.minecraft.world.biome.BiomeGenBase.Height; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.api.BOPBlockHelper; import biomesoplenty.common.configuration.BOPConfigurationMisc; import biomesoplenty.common.world.features.WorldGenBOPTallGrass; +import biomesoplenty.common.world.features.trees.WorldGenDeadTree1; public class BiomeGenWasteland extends BOPBiome { + private static final Height biomeHeight = new Height(0.3F, 0.4F); public BiomeGenWasteland(int id) { super(id); + //TODO: setHeight() + this.func_150570_a(biomeHeight); + this.setDisableRain(); + //TODO: setColor() + this.setColor(5919808); + this.setTemperatureRainfall(2.0F, 0.05F); + this.spawnableCreatureList.clear(); this.spawnableWaterCreatureList.clear(); @@ -27,15 +39,18 @@ public class BiomeGenWasteland extends BOPBiome //TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 10; this.bopWorldFeatures.waterLakesPerChunk = 2; + this.bopWorldFeatures.wasteland1PerChunk = 1; + this.bopWorldFeatures.wasteland2PerChunk = 1; + this.bopWorldFeatures.wasteland3PerChunk = 1; + this.bopWorldFeatures.wasteland4PerChunk = 1; } - /*@Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) + @Override + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) { - return par1Random.nextInt(6) == 0 ? new WorldGenDeadTree3(false) - : (par1Random.nextInt(2) == 0 ? new WorldGenWasteland2() - : new WorldGenWasteland()); - }*/ + return new WorldGenDeadTree1(false, Blocks.dirt, Blocks.grass, BOPBlockHelper.get("holyGrass"), BOPBlockHelper.get("driedDirt"), BOPBlockHelper.get("redRock")); + } @Override public HashMap getWeightedWorldGenForGrass() @@ -46,13 +61,6 @@ public class BiomeGenWasteland extends BOPBiome return grassMap; } - - - /*@Override - public WorldGenerator getRandomWorldGenForGrass(Random par1Random) - { - return par1Random.nextInt(2) == 0 ? new WorldGenWasteland4() : new WorldGenWasteland3(); - }*/ @Override //TODO: getBiomeGrassColor() diff --git a/src/main/java/biomesoplenty/common/core/BOPBiomes.java b/src/main/java/biomesoplenty/common/core/BOPBiomes.java index bef0ca1f2..3fb83e6f0 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBiomes.java +++ b/src/main/java/biomesoplenty/common/core/BOPBiomes.java @@ -60,6 +60,7 @@ import biomesoplenty.common.biomes.BiomeGenTropicalRainforest; import biomesoplenty.common.biomes.BiomeGenTropics; import biomesoplenty.common.biomes.BiomeGenTundra; import biomesoplenty.common.biomes.BiomeGenVolcano; +import biomesoplenty.common.biomes.BiomeGenWasteland; import biomesoplenty.common.biomes.BiomeGenWetland; import biomesoplenty.common.biomes.BiomeGenWoodland; import biomesoplenty.common.configuration.BOPConfigurationIDs; @@ -160,7 +161,7 @@ public class BOPBiomes registerBiome(new BOPBiomeListEntry(new BiomeGenTropics(BOPConfigurationIDs.tropicsID).setBiomeName("Tropics"), BOPBiomeTemperatureType.HOT)); registerBiome(new BOPBiomeListEntry(new BiomeGenTundra(BOPConfigurationIDs.tundraID).setBiomeName("Tundra"), BOPBiomeTemperatureType.ICY)); registerBiome(new BOPBiomeListEntry(new BiomeGenVolcano(BOPConfigurationIDs.volcanoID).setBiomeName("Volcano"), BOPBiomeTemperatureType.HOT)); - //registerBiome(new BOPBiomeListEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), BOPBiomeTemperatureType.HOT)); + registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), BOPBiomeTemperatureType.HOT)); registerBiome(new BOPBiomeListEntry(new BiomeGenWetland(BOPConfigurationIDs.wetlandID).setBiomeName("Wetland"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenWoodland(BOPConfigurationIDs.woodlandID).setBiomeName("Woodland"), BOPBiomeTemperatureType.WARM)); } diff --git a/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java b/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java index b52be0f64..6135970e6 100644 --- a/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java +++ b/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java @@ -54,6 +54,10 @@ public class BOPWorldFeatures public int lavaSpoutsPerChunk = 0; public int cobwebsPerChunk = 0; public int cobwebNestsPerChunk = 0; + public int wasteland1PerChunk = 0; + public int wasteland2PerChunk = 0; + public int wasteland3PerChunk = 0; + public int wasteland4PerChunk = 0; public int bopFlowersPerChunk = 0; } diff --git a/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland.java b/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland.java new file mode 100644 index 000000000..8b0c9825e --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland.java @@ -0,0 +1,152 @@ +package biomesoplenty.common.world.features; + +import java.lang.reflect.Field; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.decoration.IBOPDecoration; +import biomesoplenty.common.world.generation.WorldGeneratorBOP; + +public class WorldGenWasteland extends WorldGeneratorBOP +{ + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + //TODO: isAirBlock() + while (world.func_147437_c(x, y, z) && y > 2) + { + --y; + } + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); + + if (block != BOPBlockHelper.get("driedDirt")) + { + return false; + } + else + { + for (int var7 = -2; var7 <= 2; ++var7) + { + for (int var8 = -2; var8 <= 2; ++var8) + { + //TODO: isAirBlock() isAirBlock() isAirBlock() + if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8) && !world.func_147437_c(x + var7, y, z + var8)) + { + return false; + } + } + } + + world.func_147449_b(x, y, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 2, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z + 2, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 1, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 1, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 2, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y + 1, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 1, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 1, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 1, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 1, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 1, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z + 2, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 2, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 2, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 2, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 2, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 2, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 2, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 2, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 2, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 2, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 3, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 3, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 3, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 3, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 3, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 3, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 3, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 3, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 3, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 4, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 4, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 4, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 4, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 4, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 5, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 5, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 5, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 5, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 5, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 6, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 7, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 8, z, BOPBlockHelper.get("driedDirt")); + + return true; + } + } + + @Override + public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception + { + for (int i = 0; i < worldGeneratorField.getInt(bopDecoration.getWorldFeatures()); i++) + { + int randX = x + random.nextInt(16) + 8; + int randZ = z + random.nextInt(16) + 8; + int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } +} diff --git a/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland2.java b/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland2.java new file mode 100644 index 000000000..fe9ad17d6 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland2.java @@ -0,0 +1,194 @@ +package biomesoplenty.common.world.features; + +import java.lang.reflect.Field; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.decoration.IBOPDecoration; +import biomesoplenty.common.world.generation.WorldGeneratorBOP; + +public class WorldGenWasteland2 extends WorldGeneratorBOP +{ + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + //TODO: isAirBlock() + while (world.func_147437_c(x, y, z) && y > 2) + { + --y; + } + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); + + if (block != BOPBlockHelper.get("driedDirt")) + { + return false; + } + else + { + for (int var7 = -2; var7 <= 2; ++var7) + { + for (int var8 = -2; var8 <= 2; ++var8) + { + //TODO: isAirBlock() isAirBlock() isAirBlock() + if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8) && !world.func_147437_c(x + var7, y, z + var8)) + { + return false; + } + } + } + + world.func_147449_b(x, y, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 2, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z + 2, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 1, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 1, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 2, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y + 1, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 1, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 1, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 1, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 1, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 1, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 1, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 1, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 1, z + 2, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 2, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 2, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 2, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 2, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 2, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 2, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 2, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 2, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 2, y + 2, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y + 2, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 2, y + 2, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 2, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 2, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 2, y + 2, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 2, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 2, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 2, z - 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 2, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 2, z + 2, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 2, z + 2, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 2, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 3, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 3, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 3, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 3, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 3, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 3, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 3, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 3, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 3, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 4, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 4, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 4, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 4, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 4, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 4, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 4, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 4, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 4, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 5, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 5, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 5, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 5, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 5, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 5, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y + 5, z + 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 5, z - 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 5, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 6, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 6, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 6, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 6, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 6, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 7, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 7, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 7, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 7, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 7, z, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x - 1, y + 8, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y + 8, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 8, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 8, z + 1, BOPBlockHelper.get("driedDirt")); + + world.func_147449_b(x, y + 8, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 9, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 10, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 11, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y + 12, z, BOPBlockHelper.get("driedDirt")); + + return true; + } + } + + @Override + public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception + { + for (int i = 0; i < worldGeneratorField.getInt(bopDecoration.getWorldFeatures()); i++) + { + int randX = x + random.nextInt(16) + 8; + int randZ = z + random.nextInt(16) + 8; + int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } +} diff --git a/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland3.java b/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland3.java new file mode 100644 index 000000000..dae1993ef --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland3.java @@ -0,0 +1,87 @@ +package biomesoplenty.common.world.features; + +import java.lang.reflect.Field; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.decoration.IBOPDecoration; +import biomesoplenty.common.world.generation.WorldGeneratorBOP; + +public class WorldGenWasteland3 extends WorldGeneratorBOP +{ + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + //TODO: isAirBlock() + while (world.func_147437_c(x, y, z) && y > 2) + { + --y; + } + + Block var6 = world.func_147439_a(x, y, z); + Block var95 = world.func_147439_a(x - 1, y, z); + Block var96 = world.func_147439_a(x + 1, y, z); + Block var97 = world.func_147439_a(x, y, z - 1); + Block var98 = world.func_147439_a(x, y, z + 1); + + if (var6 != BOPBlockHelper.get("driedDirt") || var95 != BOPBlockHelper.get("driedDirt") || var96 != BOPBlockHelper.get("driedDirt") || var97 != BOPBlockHelper.get("driedDirt") || var98 != BOPBlockHelper.get("driedDirt") ) + return false; + else + { + for (int var7 = -2; var7 <= 2; ++var7) + { + for (int var8 = -2; var8 <= 2; ++var8) + { + //TODO: isAirBlock() isAirBlock() + if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8)) + { + return false; + } + } + } + + int var999 = random.nextInt(2); + + if (var999 == 0) + { + world.func_147449_b(x, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x - 1, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x + 1, y, z, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z - 1, BOPBlockHelper.get("driedDirt")); + world.func_147449_b(x, y, z + 1, BOPBlockHelper.get("driedDirt")); + this.func_150516_a(world, x, y + 1, z, BOPBlockHelper.get("driedDirt"), 0); + this.func_150516_a(world, x + 1, y + 1, z, BOPBlockHelper.get("driedDirt"), 0); + this.func_150516_a(world, x - 1, y + 1, z, BOPBlockHelper.get("driedDirt"), 0); + this.func_150516_a(world, x, y + 1, z + 1, BOPBlockHelper.get("driedDirt"), 0); + this.func_150516_a(world, x, y + 1, z - 1, BOPBlockHelper.get("driedDirt"), 0); + this.func_150516_a(world, x, y + 2, z, BOPBlockHelper.get("driedDirt"), 0); + return true; + } + if (var999 == 1) + { + world.func_147449_b(x, y, z, BOPBlockHelper.get("driedDirt")); + this.func_150516_a(world, x, y + 1, z, BOPBlockHelper.get("driedDirt"), 0); + return true; + } + + return true; + } + } + + @Override + public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception + { + for (int i = 0; i < worldGeneratorField.getInt(bopDecoration.getWorldFeatures()); i++) + { + int randX = x + random.nextInt(16) + 8; + int randZ = z + random.nextInt(16) + 8; + int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } +} diff --git a/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland4.java b/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland4.java new file mode 100644 index 000000000..ef98b7d95 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/WorldGenWasteland4.java @@ -0,0 +1,83 @@ +package biomesoplenty.common.world.features; + +import java.lang.reflect.Field; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.decoration.IBOPDecoration; +import biomesoplenty.common.world.generation.WorldGeneratorBOP; + +public class WorldGenWasteland4 extends WorldGeneratorBOP +{ + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + //TODO: isAirBlock() + while (world.func_147437_c(x, y, z) && y > 2) + { + --y; + } + + Block var6 = world.func_147439_a(x, y, z); + Block var95 = world.func_147439_a(x - 1, y, z); + Block var96 = world.func_147439_a(x + 1, y, z); + Block var97 = world.func_147439_a(x, y, z - 1); + Block var98 = world.func_147439_a(x, y, z + 1); + + if (var6 != BOPBlockHelper.get("driedDirt") || var95 != BOPBlockHelper.get("driedDirt") || var96 != BOPBlockHelper.get("driedDirt") || var97 != BOPBlockHelper.get("driedDirt") || var98 != BOPBlockHelper.get("driedDirt") ) + return false; + else + { + for (int var7 = -2; var7 <= 2; ++var7) + { + for (int var8 = -2; var8 <= 2; ++var8) + { + //TODO: isAirBlock() isAirBlock() + if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8)) + { + return false; + } + } + } + + int var999 = random.nextInt(2); + + if (var999 == 0) + { + //TODO: setBlock() + this.func_150515_a(world, x, y - 1, z, Blocks.air); + this.func_150515_a(world, x + 1, y - 1, z, Blocks.air); + this.func_150515_a(world, x - 1, y - 1, z, Blocks.air); + this.func_150515_a(world, x, y - 1, z + 1, Blocks.air); + this.func_150515_a(world, x, y - 1, z - 1, Blocks.air); + this.func_150515_a(world, x, y - 2, z, Blocks.air); + return true; + } + if (var999 == 1) + { + this.func_150515_a(world, x, y - 1, z, Blocks.air); + return true; + } + + return true; + } + } + + @Override + public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception + { + for (int i = 0; i < worldGeneratorField.getInt(bopDecoration.getWorldFeatures()); i++) + { + int randX = x + random.nextInt(16) + 8; + int randZ = z + random.nextInt(16) + 8; + int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } +} diff --git a/src/main/java/biomesoplenty/common/world/generation/WorldGenFieldAssociation.java b/src/main/java/biomesoplenty/common/world/generation/WorldGenFieldAssociation.java index b0d4e81af..252021795 100644 --- a/src/main/java/biomesoplenty/common/world/generation/WorldGenFieldAssociation.java +++ b/src/main/java/biomesoplenty/common/world/generation/WorldGenFieldAssociation.java @@ -18,6 +18,10 @@ import biomesoplenty.common.world.features.WorldGenLog; import biomesoplenty.common.world.features.WorldGenRiverCane; import biomesoplenty.common.world.features.WorldGenRockpile; import biomesoplenty.common.world.features.WorldGenSplotches; +import biomesoplenty.common.world.features.WorldGenWasteland; +import biomesoplenty.common.world.features.WorldGenWasteland2; +import biomesoplenty.common.world.features.WorldGenWasteland3; +import biomesoplenty.common.world.features.WorldGenWasteland4; import biomesoplenty.common.world.features.WorldGenWaterReeds; import biomesoplenty.common.world.features.WorldGenWaterside; @@ -81,7 +85,11 @@ public class WorldGenFieldAssociation associateField("lavaSpoutsPerChunk", new WorldGenLavaSpout()); associateField("cobwebsPerChunk", new WorldGenBOPFlora(Blocks.web, 0)); associateField("cobwebNestsPerChunk", new WorldGenCobwebNest()); - + associateField("wasteland1PerChunk", new WorldGenWasteland()); + associateField("wasteland2PerChunk", new WorldGenWasteland2()); + associateField("wasteland3PerChunk", new WorldGenWasteland3()); + associateField("wasteland4PerChunk", new WorldGenWasteland4()); + associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8)); associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8)); }