From f68fd802b958a23caf41483f6063bb2d0943499c Mon Sep 17 00:00:00 2001 From: Adubbz Date: Tue, 7 May 2013 17:43:37 +1000 Subject: [PATCH] Revert "Fixed the world gen for plants and flowers." This reverts commit ca5b7b4fe853e251526de1f9cf624f61a2ad57a2. --- .../biomesoplenty/blocks/BlockBOPFlower.java | 19 ++++++++++--------- .../biomesoplenty/blocks/BlockBOPPlant.java | 4 ++-- .../worldgen/WorldGenBOPFlowers.java | 3 +-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPFlower.java b/src/minecraft/biomesoplenty/blocks/BlockBOPFlower.java index c1b115963..df1101e99 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPFlower.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPFlower.java @@ -150,33 +150,34 @@ public class BlockBOPFlower extends BlockFlower { int id = world.getBlockId(x, y - 1, z); int meta = itemStack.getItemDamage(); + boolean sky = world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z); if (itemStack.itemID == this.blockID) switch (meta) { case 10: // Toadstool - return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID; + return sky && id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID; case 11: // Cactus - return id == Blocks.redRock.get().blockID || id == Block.sand.blockID; + return sky && id == Blocks.redRock.get().blockID || id == Block.sand.blockID; case 12: // Yucca - return id == Blocks.hardDirt.get().blockID || id == Blocks.redRock.get().blockID || id == Block.sand.blockID; + return sky && id == Blocks.hardDirt.get().blockID || id == Blocks.redRock.get().blockID || id == Block.sand.blockID; case 13: // Portobello - return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID; + return sky && id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID; case 14: // Blue Milk Cap - return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID || id == Blocks.holyGrass.get().blockID; + return sky && id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID || id == Blocks.holyGrass.get().blockID; default: - return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID; + return sky && id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID; } else - return this.canPlaceBlockOnSide(world, x, y, z, side); + return sky && this.canPlaceBlockOnSide(world, x, y, z, side); } - @Override + /*@Override public boolean canBlockStay(World world, int x, int y, int z) { if (world.getBlockId(x, y, z) != this.blockID) @@ -185,7 +186,7 @@ public class BlockBOPFlower extends BlockFlower else return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z)); - } + }*/ @Override public int damageDropped(int meta) diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPPlant.java b/src/minecraft/biomesoplenty/blocks/BlockBOPPlant.java index 00e91fd8e..b5226f6de 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPPlant.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPPlant.java @@ -104,7 +104,7 @@ public class BlockBOPPlant extends BlockFlower implements IShearable else if (metadata == 4) //Holy Tall Grass return blockID == Blocks.holyGrass.get().blockID; else if (metadata == 5) - return blockID == Block.grass.blockID || blockID == Block.dirt.blockID; + return true; else if (metadata == 7) return blockID == Block.grass.blockID; else if (metadata == 8) @@ -144,7 +144,7 @@ public class BlockBOPPlant extends BlockFlower implements IShearable return id == Blocks.holyGrass.get().blockID; case 5: // Thorns - return id == Block.grass.blockID || id == Block.dirt.blockID; + return true; case 7: // Cattail return id != Block.grass.blockID ? false : (world.getBlockMaterial(x - 1, y - 1, z) == Material.water ? true : (world.getBlockMaterial(x + 1, y - 1, z) == Material.water ? true : (world.getBlockMaterial(x, y - 1, z - 1) == Material.water ? true : world.getBlockMaterial(x, y - 1, z + 1) == Material.water))); diff --git a/src/minecraft/biomesoplenty/worldgen/WorldGenBOPFlowers.java b/src/minecraft/biomesoplenty/worldgen/WorldGenBOPFlowers.java index 21689d33c..f04bbd4ec 100644 --- a/src/minecraft/biomesoplenty/worldgen/WorldGenBOPFlowers.java +++ b/src/minecraft/biomesoplenty/worldgen/WorldGenBOPFlowers.java @@ -26,8 +26,7 @@ public class WorldGenBOPFlowers extends WorldGenerator int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); - if (par1World.isAirBlock(i1, j1, k1) && (!par1World.provider.hasNoSky || j1 < 127) && (par1World.getFullBlockLightValue(i1, j1, k1) >= 8 || par1World.canBlockSeeTheSky(i1, j1, k1)) - && Block.blocksList[this.plantBlockId].canPlaceBlockOnSide(par1World, i1, j1, k1, 1, new ItemStack(this.plantBlockId, 1, this.plantBlockMeta))) + if (par1World.isAirBlock(i1, j1, k1) && (!par1World.provider.hasNoSky || j1 < 127) && Block.blocksList[this.plantBlockId].canPlaceBlockOnSide(par1World, i1, j1, k1, 1, new ItemStack(this.plantBlockId, 1, this.plantBlockMeta))) { par1World.setBlock(i1, j1, k1, this.plantBlockId, this.plantBlockMeta, 2); }