diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java index 26b1a47801..4e7cedd6fc 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java @@ -365,7 +365,7 @@ private static ItemStack deployOnBlock( @Nonnull ItemStack stack, ITurtleAccess // Do the deploying (put everything in the players inventory) boolean placed = false; - + TileEntity existingTile = turtle.getWorld().getTileEntity( position ); // See PlayerInteractionManager.processRightClickBlock PlayerInteractEvent.RightClickBlock event = ForgeHooks.onRightClickBlock( turtlePlayer, EnumHand.MAIN_HAND, position, side, new Vec3d( hitX, hitY, hitZ ) ); @@ -409,12 +409,11 @@ else if( actionResult == null ) { World world = turtle.getWorld(); TileEntity tile = world.getTileEntity( position ); - if( tile == null ) + if( tile == null || tile == existingTile ) { - BlockPos newPosition = WorldUtil.moveCoords( position, side ); - tile = world.getTileEntity( newPosition ); + tile = world.getTileEntity( WorldUtil.moveCoords( position, side ) ); } - if( tile != null && tile instanceof TileEntitySign ) + if( tile instanceof TileEntitySign ) { TileEntitySign signTile = (TileEntitySign) tile; String s = (String)extraArguments[0];