diff --git a/src/minecraft/assets/biomesoplenty/textures/blocks/bluecoral.png b/src/minecraft/assets/biomesoplenty/textures/blocks/bluecoral.png index 3f2e7656f..08e3e4169 100644 Binary files a/src/minecraft/assets/biomesoplenty/textures/blocks/bluecoral.png and b/src/minecraft/assets/biomesoplenty/textures/blocks/bluecoral.png differ diff --git a/src/minecraft/assets/biomesoplenty/textures/blocks/glowcoral.png b/src/minecraft/assets/biomesoplenty/textures/blocks/glowcoral.png index 07acb648e..3096c129f 100644 Binary files a/src/minecraft/assets/biomesoplenty/textures/blocks/glowcoral.png and b/src/minecraft/assets/biomesoplenty/textures/blocks/glowcoral.png differ diff --git a/src/minecraft/assets/biomesoplenty/textures/blocks/orangecoral.png b/src/minecraft/assets/biomesoplenty/textures/blocks/orangecoral.png index b64417df4..bb2f5e7da 100644 Binary files a/src/minecraft/assets/biomesoplenty/textures/blocks/orangecoral.png and b/src/minecraft/assets/biomesoplenty/textures/blocks/orangecoral.png differ diff --git a/src/minecraft/assets/biomesoplenty/textures/blocks/pinkcoral.png b/src/minecraft/assets/biomesoplenty/textures/blocks/pinkcoral.png index bf43534a1..b1d0cdadc 100644 Binary files a/src/minecraft/assets/biomesoplenty/textures/blocks/pinkcoral.png and b/src/minecraft/assets/biomesoplenty/textures/blocks/pinkcoral.png differ diff --git a/src/minecraft/biomesoplenty/biomes/BiomeDecoratorBOP.java b/src/minecraft/biomesoplenty/biomes/BiomeDecoratorBOP.java index 8258f81a4..7339ceed8 100644 --- a/src/minecraft/biomesoplenty/biomes/BiomeDecoratorBOP.java +++ b/src/minecraft/biomesoplenty/biomes/BiomeDecoratorBOP.java @@ -62,6 +62,7 @@ import biomesoplenty.worldgen.WorldGenCanyonGrass; import biomesoplenty.worldgen.WorldGenCattail; import biomesoplenty.worldgen.WorldGenCloud; import biomesoplenty.worldgen.WorldGenCobwebs; +import biomesoplenty.worldgen.WorldGenCoral; import biomesoplenty.worldgen.WorldGenCrystal1; import biomesoplenty.worldgen.WorldGenCrystal2; import biomesoplenty.worldgen.WorldGenDesertCactus; @@ -90,6 +91,7 @@ import biomesoplenty.worldgen.WorldGenQuagmire; import biomesoplenty.worldgen.WorldGenQuicksand; import biomesoplenty.worldgen.WorldGenReedBOP; import biomesoplenty.worldgen.WorldGenShield; +import biomesoplenty.worldgen.WorldGenShortKelp; import biomesoplenty.worldgen.WorldGenSmolderingGrass; import biomesoplenty.worldgen.WorldGenSprout; import biomesoplenty.worldgen.WorldGenSteppe; @@ -211,8 +213,10 @@ public class BiomeDecoratorBOP extends BiomeDecorator protected WorldGenerator crystalGen; protected WorldGenerator crystalGen2; protected WorldGenerator kelpGen; + protected WorldGenerator shortKelpGen; protected WorldGenerator graveGen; protected WorldGenerator pumpkinAltGen; + protected WorldGenerator coralGen; protected WorldGenerator boneSpineGen; protected WorldGenerator boneSpine2Gen; @@ -294,8 +298,10 @@ public class BiomeDecoratorBOP extends BiomeDecorator protected int cobwebsPerChunk; protected int kelpPerChunk; protected int kelpThickPerChunk; + protected int shortKelpPerChunk; protected int gravesPerChunk; protected int pumpkinsPerChunk; + protected int coralPerChunk; protected int boneSpinesPerChunk; protected int boneSpines2PerChunk; @@ -442,6 +448,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator berryBushGen = new WorldGenBOPFlowers(Blocks.foliage.get().blockID, 8); tinyCactusGen = new WorldGenBOPFlowers(Blocks.plants.get().blockID, 12); aloeGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 12); + coralGen = new WorldGenCoral(Blocks.coral.get().blockID, 4); lilyflowerGen = new WorldGenLilyflower(); deathbloomGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 2); hydrangeaGen = new WorldGenBOPFlowers(Blocks.flowers.get().blockID, 4); @@ -459,6 +466,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator crystalGen = new WorldGenCrystal1(); crystalGen2 = new WorldGenCrystal2(); kelpGen = new WorldGenKelp(false); + shortKelpGen = new WorldGenShortKelp(false); graveGen = new WorldGenGrave(); mushroomBrownGen = new WorldGenBOPFlowers(Block.mushroomBrown.blockID, 0); mushroomRedGen = new WorldGenBOPFlowers(Block.mushroomRed.blockID, 0); @@ -562,8 +570,10 @@ public class BiomeDecoratorBOP extends BiomeDecorator cobwebsPerChunk = 0; kelpPerChunk = 0; kelpThickPerChunk = 0; + shortKelpPerChunk = 0; gravesPerChunk = 0; pumpkinsPerChunk = 0; + coralPerChunk = 0; generateLakes = true; generateAsh = false; generateMycelium = false; @@ -985,6 +995,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator kelpGen.generate(currentWorld, randomGenerator, var3, var4, var5); } + for (var2 = 0; var2 < shortKelpPerChunk; ++var2) + { + var3 = chunk_X + randomGenerator.nextInt(16); + var4 = randomGenerator.nextInt(64); + var5 = chunk_Z + randomGenerator.nextInt(16); + shortKelpGen.generate(currentWorld, randomGenerator, var3, var4, var5); + } + for (var2 = 0; var2 < rainbowflowersPerChunk; ++var2) { int var956 = randomGenerator.nextInt(10); @@ -1054,6 +1072,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator var5 = chunk_Z + randomGenerator.nextInt(16) + 8; plantWhiteGen.generate(currentWorld, randomGenerator, var3, var4, var5); } + + for (var2 = 0; var2 < coralPerChunk; ++var2) + { + var3 = chunk_X + randomGenerator.nextInt(16) + 8; + var4 = randomGenerator.nextInt(256); + var5 = chunk_Z + randomGenerator.nextInt(16) + 8; + coralGen.generate(currentWorld, randomGenerator, var3, var4, var5); + } for (var2 = 0; var2 < blueFlowersPerChunk; ++var2) { diff --git a/src/minecraft/biomesoplenty/biomes/BiomeGenOceanCoral.java b/src/minecraft/biomesoplenty/biomes/BiomeGenOceanCoral.java index a07319b63..e804680c0 100644 --- a/src/minecraft/biomesoplenty/biomes/BiomeGenOceanCoral.java +++ b/src/minecraft/biomesoplenty/biomes/BiomeGenOceanCoral.java @@ -9,9 +9,15 @@ import biomesoplenty.api.Blocks; public class BiomeGenOceanCoral extends BiomeGenBase { + private BiomeDecoratorBOP customBiomeDecorator; + public BiomeGenOceanCoral(int par1) { super(par1); + theBiomeDecorator = new BiomeDecoratorBOP(this); + customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; + customBiomeDecorator.coralPerChunk = 200; + customBiomeDecorator.shortKelpPerChunk = 99; spawnableCreatureList.clear(); } diff --git a/src/minecraft/biomesoplenty/biomes/BiomeGenOceanKelp.java b/src/minecraft/biomesoplenty/biomes/BiomeGenOceanKelp.java index 19c207cf3..b43f28100 100644 --- a/src/minecraft/biomesoplenty/biomes/BiomeGenOceanKelp.java +++ b/src/minecraft/biomesoplenty/biomes/BiomeGenOceanKelp.java @@ -18,6 +18,7 @@ public class BiomeGenOceanKelp extends BiomeGenBase customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; customBiomeDecorator.kelpPerChunk = 999; customBiomeDecorator.kelpThickPerChunk = 999; + customBiomeDecorator.shortKelpPerChunk = 200; spawnableCreatureList.clear(); } diff --git a/src/minecraft/biomesoplenty/worldgen/WorldGenCoral.java b/src/minecraft/biomesoplenty/worldgen/WorldGenCoral.java new file mode 100644 index 000000000..da0dc3fe1 --- /dev/null +++ b/src/minecraft/biomesoplenty/worldgen/WorldGenCoral.java @@ -0,0 +1,41 @@ +package biomesoplenty.worldgen; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.Blocks; + +public class WorldGenCoral extends WorldGenerator +{ + /** The ID of the plant block used in this plant generator. */ + private int plantBlockId; + private int plantBlockMeta; + + public WorldGenCoral(int par1, int meta) + { + plantBlockId = par1; + plantBlockMeta = meta; + } + + @Override + public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + { + for (int l = 0; l < 64; ++l) + { + int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); + int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); + int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); + int var999 = par2Random.nextInt(4); + + if ((par1World.getBlockId(i1, j1, k1) == Block.waterStill.blockID || par1World.getBlockId(i1, j1, k1) == Block.waterMoving.blockID) && Block.blocksList[plantBlockId].canPlaceBlockOnSide(par1World, i1, j1, k1, 1, new ItemStack(plantBlockId, 1, plantBlockMeta))) + { + par1World.setBlock(i1, j1, k1, Blocks.coral.get().blockID, 4 + var999, 2); + } + } + + return true; + } +} diff --git a/src/minecraft/biomesoplenty/worldgen/WorldGenShortKelp.java b/src/minecraft/biomesoplenty/worldgen/WorldGenShortKelp.java new file mode 100644 index 000000000..e6fb9006c --- /dev/null +++ b/src/minecraft/biomesoplenty/worldgen/WorldGenShortKelp.java @@ -0,0 +1,109 @@ +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; +import net.minecraft.block.material.Material; + +public class WorldGenShortKelp extends WorldGenerator +{ + public WorldGenShortKelp(boolean var1) + { + super(var1); + } + + @Override + public boolean generate(World var1, Random var2, int var3, int var4, int var5) + { + int var6 = var2.nextInt(4) + 3; + int var7 = var2.nextInt(3) + 2; + int var8 = var6 - var7; + int var9 = 1; + boolean var10 = true; + + if (var4 >= 1 && var4 + var6 + 1 <= 256) + { + int var11; + int var13; + int var15; + int var21; + + var11 = var1.getBlockId(var3, var4 - 1, var5); + + if ((var11 == Block.sand.blockID || var11 == Block.dirt.blockID) && var4 < 256 - var6 - 1) + { + + if (var1.getBlockMaterial(var3, var4, var5) != Material.water) + { + return false; + } + + var21 = var2.nextInt(2); + var13 = 1; + boolean var22 = false; + int var17; + int var16; + int var999 = 0; + int var998; + int var996; + + for (var15 = 0; var15 <= var8; ++var15) + { + var16 = var4 + var6 - var15; + + if (var21 >= var13) + { + var21 = var22 ? 1 : 0; + var22 = true; + ++var13; + + if (var13 > var9) + { + var13 = var9; + } + } + else + { + ++var21; + } + } + + var15 = var2.nextInt(3); + + for (var16 = 0; var16 < var6 - var15; ++var16) + { + var17 = var1.getBlockId(var3, (var4 + (var16 + 2)), var5); + + if (var17 == Block.waterStill.blockID || var17 == Block.waterMoving.blockID) + { + this.setBlockAndMetadata(var1, var3, var4, var5, Blocks.coral.get().blockID, 0); + this.setBlockAndMetadata(var1, var3, var4 + var16, var5, Blocks.coral.get().blockID, 1); + ++var999; + } + } + + var998 = var1.getBlockId(var3, (var4 + (var999 + 1)), var5); + + if (var998 == Block.waterStill.blockID || var998 == Block.waterMoving.blockID) + { + if (var999 == 0) + { + this.setBlockAndMetadata(var1, var3, var4, var5, Blocks.coral.get().blockID, 3); + } + else + { + this.setBlockAndMetadata(var1, var3, var4, var5, Blocks.coral.get().blockID, 0); + this.setBlockAndMetadata(var1, var3, var4 + var999, var5, Blocks.coral.get().blockID, 2); + } + } + + return true; + } else + return false; + } else + return false; + } +}