1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-28 18:04:47 +00:00

Fix turtle block placing failing

This commit is contained in:
SquidDev 2019-06-02 17:25:49 +01:00
parent 7467b7f88a
commit 401bbf2e6a

View File

@ -17,7 +17,6 @@ import dan200.computercraft.shared.util.DirectionUtil;
import dan200.computercraft.shared.util.DropConsumer; import dan200.computercraft.shared.util.DropConsumer;
import dan200.computercraft.shared.util.InventoryUtil; import dan200.computercraft.shared.util.InventoryUtil;
import dan200.computercraft.shared.util.WorldUtil; import dan200.computercraft.shared.util.WorldUtil;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -299,7 +298,6 @@ public class TurtlePlaceCommand implements ITurtleCommand
} }
IBlockState state = world.getBlockState( position ); IBlockState state = world.getBlockState( position );
Block block = state.getBlock();
boolean replaceable = state.isReplaceable( context ); boolean replaceable = state.isReplaceable( context );
if( !allowReplaceable && replaceable ) return false; if( !allowReplaceable && replaceable ) return false;
@ -317,8 +315,7 @@ public class TurtlePlaceCommand implements ITurtleCommand
} }
} }
// Check the block is solid or liquid return context.canPlace();
return block.isCollidable( state );
} }
@Nonnull @Nonnull