Revert "Fixed the world gen for plants and flowers."

This reverts commit ca5b7b4fe8.
This commit is contained in:
Adubbz 2013-05-07 17:43:37 +10:00
parent f7ae70170f
commit f68fd802b9
3 changed files with 13 additions and 13 deletions

View File

@ -150,33 +150,34 @@ public class BlockBOPFlower extends BlockFlower
{ {
int id = world.getBlockId(x, y - 1, z); int id = world.getBlockId(x, y - 1, z);
int meta = itemStack.getItemDamage(); int meta = itemStack.getItemDamage();
boolean sky = world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z);
if (itemStack.itemID == this.blockID) if (itemStack.itemID == this.blockID)
switch (meta) switch (meta)
{ {
case 10: // Toadstool 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 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 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 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 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: 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 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) public boolean canBlockStay(World world, int x, int y, int z)
{ {
if (world.getBlockId(x, y, z) != this.blockID) if (world.getBlockId(x, y, z) != this.blockID)
@ -185,7 +186,7 @@ public class BlockBOPFlower extends BlockFlower
else else
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) 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)); && this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z), world.getBlockMetadata(x, y, z));
} }*/
@Override @Override
public int damageDropped(int meta) public int damageDropped(int meta)

View File

@ -104,7 +104,7 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
else if (metadata == 4) //Holy Tall Grass else if (metadata == 4) //Holy Tall Grass
return blockID == Blocks.holyGrass.get().blockID; return blockID == Blocks.holyGrass.get().blockID;
else if (metadata == 5) else if (metadata == 5)
return blockID == Block.grass.blockID || blockID == Block.dirt.blockID; return true;
else if (metadata == 7) else if (metadata == 7)
return blockID == Block.grass.blockID; return blockID == Block.grass.blockID;
else if (metadata == 8) else if (metadata == 8)
@ -144,7 +144,7 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
return id == Blocks.holyGrass.get().blockID; return id == Blocks.holyGrass.get().blockID;
case 5: // Thorns case 5: // Thorns
return id == Block.grass.blockID || id == Block.dirt.blockID; return true;
case 7: // Cattail 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))); 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)));

View File

@ -26,8 +26,7 @@ public class WorldGenBOPFlowers extends WorldGenerator
int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); 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)) 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)))
&& 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); par1World.setBlock(i1, j1, k1, this.plantBlockId, this.plantBlockMeta, 2);
} }