diff --git a/core/sync/GuiBridge.java b/core/sync/GuiBridge.java index 616ec74d9..c94186eaf 100644 --- a/core/sync/GuiBridge.java +++ b/core/sync/GuiBridge.java @@ -307,9 +307,10 @@ public enum GuiBridge implements IGuiHandler public Object getServerGuiElement(int ID_ORDINAL, EntityPlayer player, World w, int x, int y, int z) { ForgeDirection side = ForgeDirection.getOrientation( ID_ORDINAL & 0x07 ); - GuiBridge ID = values()[ID_ORDINAL >> 3]; + GuiBridge ID = values()[ID_ORDINAL >> 4]; + boolean istem = ((ID_ORDINAL >> 3) & 1) == 1; - if ( ID.type.isItem() ) + if ( ID.type.isItem() && istem ) { ItemStack it = player.inventory.getCurrentItem(); Object myItem = getGuiObject( it, player, w, x, y, z ); @@ -358,9 +359,10 @@ public enum GuiBridge implements IGuiHandler public Object getClientGuiElement(int ID_ORDINAL, EntityPlayer player, World w, int x, int y, int z) { ForgeDirection side = ForgeDirection.getOrientation( ID_ORDINAL & 0x07 ); - GuiBridge ID = values()[ID_ORDINAL >> 3]; + GuiBridge ID = values()[ID_ORDINAL >> 4]; + boolean istem = ((ID_ORDINAL >> 3) & 1) == 1; - if ( ID.type.isItem() ) + if ( ID.type.isItem() && istem ) { ItemStack it = player.inventory.getCurrentItem(); Object myItem = getGuiObject( it, player, w, x, y, z ); diff --git a/util/Platform.java b/util/Platform.java index 051651b15..f1c91495e 100644 --- a/util/Platform.java +++ b/util/Platform.java @@ -308,9 +308,9 @@ public class Platform if ( (type.getType().isItem() && tile == null) || type.hasPermissions( tile, x, y, z, side, p ) ) { if ( tile == null ) - p.openGui( AppEng.instance, type.ordinal() << 3, p.getEntityWorld(), x, y, z ); + p.openGui( AppEng.instance, type.ordinal() << 4 | (1 << 3), p.getEntityWorld(), x, y, z ); else - p.openGui( AppEng.instance, type.ordinal() << 3 | (side.ordinal()), tile.getWorldObj(), x, y, z ); + p.openGui( AppEng.instance, type.ordinal() << 4 | (side.ordinal()), tile.getWorldObj(), x, y, z ); } }