Fixed Double Plant Crash Closes #70

This commit is contained in:
canitzp 2016-02-18 21:58:19 +01:00
parent 353431827f
commit c0d13ef30f
2 changed files with 1 additions and 5 deletions

View file

@ -92,7 +92,7 @@ public class WorldDecorationEvent{
randomPos = event.world.getTopSolidOrLiquidBlock(randomPos);
if(PosUtil.getMaterial(PosUtil.offset(randomPos, 0, -1, 0), event.world) == blockBelow){
if(plant.canPlaceBlockAt(event.world, randomPos) && WorldUtil.isBlockAir(event.world, randomPos.add(0, 1, 0))){
if(plant.canPlaceBlockAt(event.world, randomPos) && event.world.isAirBlock(randomPos)){
PosUtil.setBlock(randomPos, event.world, plant, meta, 2);
}
}

View file

@ -51,10 +51,6 @@ public class WorldUtil{
}
}
public static boolean isBlockAir(World world, BlockPos pos){
return world.isAirBlock(pos);
}
public static BlockPos getCoordsFromSide(EnumFacing side, BlockPos pos, int offset){
return new BlockPos(pos.getX()+side.getFrontOffsetX()*(offset+1), pos.getY()+side.getFrontOffsetY()*(offset+1), pos.getZ()+side.getFrontOffsetZ()*(offset+1));
}