From 4a21641bcdb67b2330e10577e5ffb112baed4034 Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 15 Jun 2016 16:04:38 -0700 Subject: [PATCH] Fix backpacks trying to interact with inventories in a sided way --- src/main/java/forestry/storage/items/ItemBackpack.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/forestry/storage/items/ItemBackpack.java b/src/main/java/forestry/storage/items/ItemBackpack.java index fa5e5447e..868a8fe5a 100755 --- a/src/main/java/forestry/storage/items/ItemBackpack.java +++ b/src/main/java/forestry/storage/items/ItemBackpack.java @@ -97,11 +97,10 @@ public class ItemBackpack extends ItemWithGui implements IColoredItem { @Override public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) { // We only do this when shift is clicked - if (!player.isSneaking()) { - return EnumActionResult.FAIL; + if (player.isSneaking()) { + return evaluateTileHit(stack, player, world, pos, side) ? EnumActionResult.PASS : EnumActionResult.FAIL; } - - return evaluateTileHit(stack, player, world, pos, side) ? EnumActionResult.PASS : EnumActionResult.FAIL; + return super.onItemUseFirst(stack, player, world, pos, side, hitX, hitY, hitZ, hand); } public static void tryStowing(EntityPlayer player, ItemStack backpackStack, ItemStack stack) { @@ -138,7 +137,7 @@ public class ItemBackpack extends ItemWithGui implements IColoredItem { private static IItemHandler getInventoryHit(World world, BlockPos pos, EnumFacing side) { TileEntity targeted = world.getTileEntity(pos); - return TileUtil.getInventoryFromTile(targeted, side); + return TileUtil.getInventoryFromTile(targeted, null); } private boolean evaluateTileHit(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side) {