Fix possible NPE warning

This commit is contained in:
Brady 2018-08-02 10:56:26 -07:00
parent 9ce1b9250f
commit 1bfabdf66b
No known key found for this signature in database
GPG Key ID: 73A788379A197567

View File

@ -55,7 +55,7 @@ public interface ActionWorldHelper extends ActionCosts {
static boolean avoidBreaking(BlockPos pos) { static boolean avoidBreaking(BlockPos pos) {
Block b = BlockStateInterface.get(pos).getBlock(); Block b = BlockStateInterface.get(pos).getBlock();
Block below = BlockStateInterface.get(new BlockPos(pos.getX(), pos.getY() - 1, pos.getZ())).getBlock(); Block below = BlockStateInterface.get(new BlockPos(pos.getX(), pos.getY() - 1, pos.getZ())).getBlock();
return Block.getBlockFromName("minecraft:ice").equals(b)//ice becomes water, and water can mess up the path return Blocks.ICE.equals(b) // ice becomes water, and water can mess up the path
|| isLiquid(new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ()))//don't break anything touching liquid on any side || isLiquid(new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ()))//don't break anything touching liquid on any side
|| isLiquid(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ())) || isLiquid(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ()))
|| isLiquid(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ())) || isLiquid(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ()))