terminal woes

This commit is contained in:
PrototypeTrousers
2023-08-11 10:27:15 -03:00
parent e6586ac360
commit 30c074021b
6 changed files with 14 additions and 6 deletions
@@ -36,7 +36,7 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable implements I
private int ticks = 0; private int ticks = 0;
public ContainerMEPortableCell(InventoryPlayer ip, IPortableCell guiObject) { public ContainerMEPortableCell(InventoryPlayer ip, IPortableCell guiObject) {
super(ip, guiObject, guiObject, true); super(ip, guiObject, guiObject, false);
if (guiObject != null) { if (guiObject != null) {
final int slotIndex = ((IInventorySlotAware) guiObject).getInventorySlot(); final int slotIndex = ((IInventorySlotAware) guiObject).getInventorySlot();
if (!((IInventorySlotAware) guiObject).isBaubleSlot()) { if (!((IInventorySlotAware) guiObject).isBaubleSlot()) {
@@ -47,6 +47,9 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable implements I
this.slot = -1; this.slot = -1;
this.lockPlayerInventorySlot(ip.currentItem); this.lockPlayerInventorySlot(ip.currentItem);
} }
this.bindPlayerInventory(ip, 0, 0);
this.portableCell = guiObject; this.portableCell = guiObject;
} }
@@ -65,6 +65,9 @@ public class ContainerMEPortableTerminal extends ContainerMEMonitorable implemen
this.slot = -1; this.slot = -1;
this.lockPlayerInventorySlot(ip.currentItem); this.lockPlayerInventorySlot(ip.currentItem);
} }
this.bindPlayerInventory(ip, 0, 0);
this.wirelessTerminalGUIObject = guiObject; this.wirelessTerminalGUIObject = guiObject;
this.upgrades = new StackUpgradeInventory(wirelessTerminalGUIObject.getItemStack(), this, 2); this.upgrades = new StackUpgradeInventory(wirelessTerminalGUIObject.getItemStack(), this, 2);
this.loadFromNBT(); this.loadFromNBT();
@@ -107,7 +110,7 @@ public class ContainerMEPortableTerminal extends ContainerMEMonitorable implemen
if (wirelessTerminalGUIObject.isBaubleSlot()) { if (wirelessTerminalGUIObject.isBaubleSlot()) {
BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack()); BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack());
} else { } else {
this.getPlayerInv().setInventorySlotContents(this.getPlayerInv().currentItem, this.wirelessTerminalGUIObject.getItemStack()); this.getPlayerInv().setInventorySlotContents(this.slot, this.wirelessTerminalGUIObject.getItemStack());
} }
} else { } else {
this.setValidContainer(false); this.setValidContainer(false);
@@ -50,7 +50,7 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEPortableTermin
private IRecipe currentRecipe; private IRecipe currentRecipe;
public ContainerWirelessCraftingTerminal(final InventoryPlayer ip, final WirelessTerminalGuiObject gui) { public ContainerWirelessCraftingTerminal(final InventoryPlayer ip, final WirelessTerminalGuiObject gui) {
super(ip, gui, true); super(ip, gui, false);
final IItemHandler crafting = this.craftingGrid; final IItemHandler crafting = this.craftingGrid;
@@ -63,6 +63,8 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEPortableTermin
this.addSlotToContainer(this.outputSlot = new SlotCraftingTerm(this.getPlayerInv().player, this.getActionSource(), this this.addSlotToContainer(this.outputSlot = new SlotCraftingTerm(this.getPlayerInv().player, this.getActionSource(), this
.getPowerSource(), this.wirelessTerminalGUIObject, crafting, crafting, this.output, 131, -72 + 18, this)); .getPowerSource(), this.wirelessTerminalGUIObject, crafting, crafting, this.output, 131, -72 + 18, this));
this.bindPlayerInventory(ip, 0, 0);
this.onCraftMatrixChanged(new WrapperInvItemHandler(crafting)); this.onCraftMatrixChanged(new WrapperInvItemHandler(crafting));
} }
@@ -138,7 +138,7 @@ public class ContainerWirelessPatternTerminal extends ContainerPatternEncoder im
if (wirelessTerminalGUIObject.isBaubleSlot()) { if (wirelessTerminalGUIObject.isBaubleSlot()) {
BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack()); BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack());
} else { } else {
this.getPlayerInv().setInventorySlotContents(this.getPlayerInv().currentItem, this.wirelessTerminalGUIObject.getItemStack()); this.getPlayerInv().setInventorySlotContents(this.slot, this.wirelessTerminalGUIObject.getItemStack());
} }
} else { } else {
this.setValidContainer(false); this.setValidContainer(false);
@@ -26,6 +26,6 @@ import net.minecraft.entity.player.InventoryPlayer;
public class ContainerWirelessTerm extends ContainerMEPortableTerminal { public class ContainerWirelessTerm extends ContainerMEPortableTerminal {
public ContainerWirelessTerm(final InventoryPlayer ip, final WirelessTerminalGuiObject gui) { public ContainerWirelessTerm(final InventoryPlayer ip, final WirelessTerminalGuiObject gui) {
super(ip, gui, true); super(ip, gui, false);
} }
} }
@@ -166,7 +166,7 @@ public class ContainerMEPortableFluidCell extends AEBaseContainer implements IAE
if (wirelessTerminalGUIObject.isBaubleSlot()) { if (wirelessTerminalGUIObject.isBaubleSlot()) {
BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack()); BaublesApi.getBaublesHandler(this.getPlayerInv().player).setStackInSlot(this.slot, this.wirelessTerminalGUIObject.getItemStack());
} else { } else {
this.getPlayerInv().setInventorySlotContents(this.getPlayerInv().currentItem, this.wirelessTerminalGUIObject.getItemStack()); this.getPlayerInv().setInventorySlotContents(this.slot, this.wirelessTerminalGUIObject.getItemStack());
} }
} else { } else {
this.setValidContainer(false); this.setValidContainer(false);