mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-29 18:28:34 +01:00
Fixed Double Plant Crash Closes #70
This commit is contained in:
parent
353431827f
commit
c0d13ef30f
2 changed files with 1 additions and 5 deletions
|
@ -92,7 +92,7 @@ public class WorldDecorationEvent{
|
||||||
randomPos = event.world.getTopSolidOrLiquidBlock(randomPos);
|
randomPos = event.world.getTopSolidOrLiquidBlock(randomPos);
|
||||||
|
|
||||||
if(PosUtil.getMaterial(PosUtil.offset(randomPos, 0, -1, 0), event.world) == blockBelow){
|
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);
|
PosUtil.setBlock(randomPos, event.world, plant, meta, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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){
|
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));
|
return new BlockPos(pos.getX()+side.getFrontOffsetX()*(offset+1), pos.getY()+side.getFrontOffsetY()*(offset+1), pos.getZ()+side.getFrontOffsetZ()*(offset+1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue