1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-26 07:03:22 +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 @@ else if( !remainder.isEmpty() )
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 @@ private static boolean canDeployOnBlock( @Nonnull BlockItemUseContext context, I
}
}
return context.canPlace();
return true;
}
@Nonnull