Fixed the world gen for plants and flowers.
This commit is contained in:
parent
960be72fe9
commit
ca5b7b4fe8
3 changed files with 13 additions and 13 deletions
|
@ -150,34 +150,33 @@ 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 sky && id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID;
|
||||
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID;
|
||||
|
||||
case 11: // Cactus
|
||||
return sky && id == Blocks.redRock.get().blockID || id == Block.sand.blockID;
|
||||
return id == Blocks.redRock.get().blockID || id == Block.sand.blockID;
|
||||
|
||||
case 12: // Yucca
|
||||
return sky && id == Blocks.hardDirt.get().blockID || id == Blocks.redRock.get().blockID || id == Block.sand.blockID;
|
||||
return id == Blocks.hardDirt.get().blockID || id == Blocks.redRock.get().blockID || id == Block.sand.blockID;
|
||||
|
||||
case 13: // Portobello
|
||||
return sky && id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID;
|
||||
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID;
|
||||
|
||||
case 14: // Blue Milk Cap
|
||||
return sky && id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID || id == Blocks.holyGrass.get().blockID;
|
||||
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.mycelium.blockID || id == Blocks.holyGrass.get().blockID;
|
||||
|
||||
default:
|
||||
return sky && id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID;
|
||||
return id == Block.grass.blockID || id == Block.dirt.blockID || id == Block.tilledField.blockID;
|
||||
}
|
||||
else
|
||||
return sky && this.canPlaceBlockOnSide(world, x, y, z, side);
|
||||
return 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)
|
||||
|
@ -186,7 +185,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)
|
||||
|
|
|
@ -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 true;
|
||||
return blockID == Block.grass.blockID || blockID == Block.dirt.blockID;
|
||||
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 true;
|
||||
return id == Block.grass.blockID || id == Block.dirt.blockID;
|
||||
|
||||
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)));
|
||||
|
|
|
@ -26,7 +26,8 @@ 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) && 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) && (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)))
|
||||
{
|
||||
par1World.setBlock(i1, j1, k1, this.plantBlockId, this.plantBlockMeta, 2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue