1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-15 19:55:42 +00:00

Fix "can deploy" check being entirely incorrect

Closes #258
This commit is contained in:
SquidDev 2019-06-21 21:51:22 +01:00
parent 42220c4268
commit 13cb789c18

View File

@ -290,9 +290,8 @@ public class TurtlePlaceCommand implements ITurtleCommand
private static boolean canDeployOnBlock( @Nonnull BlockItemUseContext context, ITurtleAccess turtle, TurtlePlayer player, BlockPos position, Direction side, boolean allowReplaceable, String[] outErrorMessage )
{
World world = turtle.getWorld();
if( World.isValid( position ) &&
!world.isAirBlock( position ) &&
!(context.getItem().getItem() instanceof BlockItem && WorldUtil.isLiquidBlock( world, position )) )
if( !World.isValid( position ) || world.isAirBlock( position ) ||
(context.getItem().getItem() instanceof BlockItem && WorldUtil.isLiquidBlock( world, position )) )
{
return false;
}
@ -315,7 +314,7 @@ public class TurtlePlaceCommand implements ITurtleCommand
}
}
return context.canPlace();
return true;
}
@Nonnull