diff --git a/client/gui/implementations/GuiMEPortableCell.java b/client/gui/implementations/GuiMEPortableCell.java index 835b8990..8951de73 100644 --- a/client/gui/implementations/GuiMEPortableCell.java +++ b/client/gui/implementations/GuiMEPortableCell.java @@ -2,12 +2,13 @@ package appeng.client.gui.implementations; import net.minecraft.entity.player.InventoryPlayer; import appeng.api.implementations.guiobjects.IPortableCell; +import appeng.container.implementations.ContainerMEPortableCell; public class GuiMEPortableCell extends GuiMEMonitorable { public GuiMEPortableCell(InventoryPlayer inventoryPlayer, IPortableCell te) { - super( inventoryPlayer, te ); + super( inventoryPlayer, te, new ContainerMEPortableCell( inventoryPlayer, null ) ); maxRows = 3; } diff --git a/container/implementations/ContainerMEPortableCell.java b/container/implementations/ContainerMEPortableCell.java index af2e3058..7ffd118c 100644 --- a/container/implementations/ContainerMEPortableCell.java +++ b/container/implementations/ContainerMEPortableCell.java @@ -14,9 +14,10 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable IPortableCell civ; public ContainerMEPortableCell(InventoryPlayer ip, IPortableCell montiorable) { - super( ip, (IStorageMonitorable) montiorable, Platform.isServer() ); + super( ip, (IStorageMonitorable) montiorable, false ); lockPlayerInventorySlot( ip.currentItem ); civ = montiorable; + bindPlayerInventory( ip, 0, 0 ); } int ticks = 0; @@ -26,18 +27,23 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable { ItemStack currentItem = getPlayerInv().getCurrentItem(); - if ( currentItem != civ.getItemStack() ) + if ( civ != null ) { - if ( currentItem != null ) + if ( currentItem != civ.getItemStack() ) { - if ( Platform.isSameItem( civ.getItemStack(), currentItem ) ) - getPlayerInv().setInventorySlotContents( getPlayerInv().currentItem, civ.getItemStack() ); + if ( currentItem != null ) + { + if ( Platform.isSameItem( civ.getItemStack(), currentItem ) ) + getPlayerInv().setInventorySlotContents( getPlayerInv().currentItem, civ.getItemStack() ); + else + getPlayerInv().player.closeScreen(); + } else getPlayerInv().player.closeScreen(); } - else - getPlayerInv().player.closeScreen(); } + else + getPlayerInv().player.closeScreen(); // drain 1 ae t ticks++;