diff --git a/src/minecraft/biomesoplenty/biomes/BiomeGenMangrove.java b/src/minecraft/biomesoplenty/biomes/BiomeGenMangrove.java index 93b21f46c..84ffaf163 100644 --- a/src/minecraft/biomesoplenty/biomes/BiomeGenMangrove.java +++ b/src/minecraft/biomesoplenty/biomes/BiomeGenMangrove.java @@ -6,6 +6,7 @@ import net.minecraft.block.Block; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.worldgen.WorldGenMangrove; +import biomesoplenty.worldgen.WorldGenMangrove2; public class BiomeGenMangrove extends BiomeGenBase { @@ -25,6 +26,7 @@ public class BiomeGenMangrove extends BiomeGenBase this.customBiomeDecorator.reedsPerChunk = -999; this.customBiomeDecorator.cactiPerChunk = -999; this.customBiomeDecorator.desertSproutsPerChunk = 1; + this.customBiomeDecorator.waterLakesPerChunk = 10; } /** @@ -32,6 +34,6 @@ public class BiomeGenMangrove extends BiomeGenBase */ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { - return new WorldGenMangrove(false); + return (WorldGenerator)(par1Random.nextInt(3) == 0 ? new WorldGenMangrove2(0,0) : new WorldGenMangrove(false)); } } diff --git a/src/minecraft/biomesoplenty/configuration/BOPBiomes.java b/src/minecraft/biomesoplenty/configuration/BOPBiomes.java index 1d114bfc0..bd4cce46b 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPBiomes.java +++ b/src/minecraft/biomesoplenty/configuration/BOPBiomes.java @@ -197,7 +197,7 @@ public class BOPBiomes { Biomes.jadeCliffs = Optional.of((new BiomeGenJadeCliffs(BOPConfiguration.jadeCliffsID)).setColor(14090235).setBiomeName("Jade Cliffs").setTemperatureRainfall(0.5F, 0.1F).setMinMaxHeight(0.1F, 2.0F)); Biomes.lushDesert = Optional.of((new BiomeGenLushDesert(BOPConfiguration.lushDesertID)).setColor(16421912).setBiomeName("Lush Desert").setTemperatureRainfall(0.8F, 0.2F).setMinMaxHeight(0.1F, 0.9F)); Biomes.lushSwamp = Optional.of((new BiomeGenLushSwamp(BOPConfiguration.lushSwampID)).setColor(522674).setBiomeName("Lush Swamp").func_76733_a(9154376).setMinMaxHeight(-0.2F, 0.1F).setTemperatureRainfall(0.7F, 1.0F)); - Biomes.mangrove = Optional.of((new BiomeGenMangrove(BOPConfiguration.mangroveID)).setColor(16440917).setBiomeName("Mangrove").setMinMaxHeight(-0.4F, -0.1F).setTemperatureRainfall(0.8F, 0.9F)); + Biomes.mangrove = Optional.of((new BiomeGenMangrove(BOPConfiguration.mangroveID)).setColor(16440917).setBiomeName("Mangrove").setMinMaxHeight(-0.2F, 0.1F).setTemperatureRainfall(0.8F, 0.9F)); Biomes.mapleWoods = Optional.of((new BiomeGenMapleWoods(BOPConfiguration.mapleWoodsID)).setColor(747097).setBiomeName("Maple Woods").func_76733_a(5159473).setTemperatureRainfall(0.2F, 0.8F).setMinMaxHeight(0.1F, 0.6F)); Biomes.marsh = Optional.of((new BiomeGenMarsh(BOPConfiguration.marshID)).setColor(10486015).setBiomeName("Marsh").setMinMaxHeight(-0.5F, 0.0F).setTemperatureRainfall(0.5F, 0.9F)); Biomes.meadow = Optional.of((new BiomeGenMeadow(BOPConfiguration.meadowID)).setColor(9286496).setBiomeName("Meadow").setTemperatureRainfall(0.7F, 0.7F)); diff --git a/src/minecraft/biomesoplenty/worldgen/WorldGenMangrove.java b/src/minecraft/biomesoplenty/worldgen/WorldGenMangrove.java index 72faf5689..d0107c227 100644 --- a/src/minecraft/biomesoplenty/worldgen/WorldGenMangrove.java +++ b/src/minecraft/biomesoplenty/worldgen/WorldGenMangrove.java @@ -114,6 +114,12 @@ public class WorldGenMangrove extends WorldGenerator if ((Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var14, var11, var16)]) { this.setBlockAndMetadata(par1World, var14, var11, var16, Blocks.leavesColorized.get().blockID, 1); + this.setBlockAndMetadata(par1World, var14, var11 - 1, var16, Blocks.leavesColorized.get().blockID, 1); + + this.setBlockAndMetadata(par1World, par3 + 1, (par4 + var6) - 3, par5, Blocks.leavesColorized.get().blockID, 1); + this.setBlockAndMetadata(par1World, par3 - 1, (par4 + var6) - 3, par5, Blocks.leavesColorized.get().blockID, 1); + this.setBlockAndMetadata(par1World, par3, (par4 + var6) - 3, par5 + 1, Blocks.leavesColorized.get().blockID, 1); + this.setBlockAndMetadata(par1World, par3, (par4 + var6) - 3, par5 - 1, Blocks.leavesColorized.get().blockID, 1); } } } @@ -129,30 +135,35 @@ public class WorldGenMangrove extends WorldGenerator this.setBlockAndMetadata(par1World, par3, par4 - 1, par5, Blocks.logs2.get().blockID, 2); this.setBlockAndMetadata(par1World, par3, par4 - 2, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3 - 1, par4, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3 + 1, par4, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3, par4, par5 - 1, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3, par4, par5 + 1, Blocks.logs2.get().blockID, 2); + + this.setBlockAndMetadata(par1World, par3 - 1, par4 - 1, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3 + 1, par4 - 1, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3, par4 - 1, par5 - 1, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3, par4 - 1, par5 + 1, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3 - 1, par4 - 2, par5, Blocks.logs2.get().blockID, 2); this.setBlockAndMetadata(par1World, par3 + 1, par4 - 2, par5, Blocks.logs2.get().blockID, 2); this.setBlockAndMetadata(par1World, par3, par4 - 2, par5 - 1, Blocks.logs2.get().blockID, 2); this.setBlockAndMetadata(par1World, par3, par4 - 2, par5 + 1, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3 - 1, par4 - 3, par5, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3 + 1, par4 - 3, par5, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3, par4 - 3, par5 - 1, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3, par4 - 3, par5 + 1, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3 - 2, par4 - 3, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3 + 2, par4 - 3, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3, par4 - 3, par5 - 2, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3, par4 - 3, par5 + 2, Blocks.logs2.get().blockID, 2); this.setBlockAndMetadata(par1World, par3 - 2, par4 - 4, par5, Blocks.logs2.get().blockID, 2); this.setBlockAndMetadata(par1World, par3 + 2, par4 - 4, par5, Blocks.logs2.get().blockID, 2); this.setBlockAndMetadata(par1World, par3, par4 - 4, par5 - 2, Blocks.logs2.get().blockID, 2); this.setBlockAndMetadata(par1World, par3, par4 - 4, par5 + 2, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3 - 2, par4 - 5, par5, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3 + 2, par4 - 5, par5, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3, par4 - 5, par5 - 2, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3, par4 - 5, par5 + 2, Blocks.logs2.get().blockID, 2); - - this.setBlockAndMetadata(par1World, par3 - 3, par4 - 6, par5, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3 + 3, par4 - 6, par5, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3, par4 - 6, par5 - 3, Blocks.logs2.get().blockID, 2); - this.setBlockAndMetadata(par1World, par3, par4 - 6, par5 + 3, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3 - 3, par4 - 5, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3 + 3, par4 - 5, par5, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3, par4 - 5, par5 - 3, Blocks.logs2.get().blockID, 2); + this.setBlockAndMetadata(par1World, par3, par4 - 5, par5 + 3, Blocks.logs2.get().blockID, 2); if (this.vinesGrow && var11 > 0) { diff --git a/src/minecraft/biomesoplenty/worldgen/WorldGenMangrove2.java b/src/minecraft/biomesoplenty/worldgen/WorldGenMangrove2.java new file mode 100644 index 000000000..71a377703 --- /dev/null +++ b/src/minecraft/biomesoplenty/worldgen/WorldGenMangrove2.java @@ -0,0 +1,61 @@ +package biomesoplenty.worldgen; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.Blocks; + +public class WorldGenMangrove2 extends WorldGenerator +{ + private int field_76527_a; + private int field_76526_b; + + public WorldGenMangrove2(int par1, int par2) + { + this.field_76526_b = par1; + this.field_76527_a = par2; + } + + public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + { + int var15; + + for (boolean var6 = false; ((var15 = par1World.getBlockId(par3, par4, par5)) == 0 || var15 == Blocks.leavesColorized.get().blockID) && par4 > 0; --par4) + { + ; + } + + int var7 = par1World.getBlockId(par3, par4, par5); + + if (var7 == Block.sand.blockID) + { + ++par4; + this.setBlockAndMetadata(par1World, par3, par4, par5, Blocks.logs2.get().blockID,2); + + for (int var8 = par4; var8 <= par4 + 1; ++var8) + { + int var9 = var8 - par4; + int var10 = 2 - var9; + + for (int var11 = par3 - var10; var11 <= par3 + var10; ++var11) + { + int var12 = var11 - par3; + + for (int var13 = par5 - var10; var13 <= par5 + var10; ++var13) + { + int var14 = var13 - par5; + + if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var11, var8, var13)]) + { + this.setBlockAndMetadata(par1World, var11, var8, var13, Blocks.leavesColorized.get().blockID, 1); + } + } + } + } + } + + return true; + } +}