Skip to content

Commit

Permalink
Lock Terminal while opening
Browse files Browse the repository at this point in the history
  • Loading branch information
zeng-github01 committed Oct 13, 2024
1 parent 2c1ffae commit 0f3af05
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import appeng.client.me.ClientDCInternalInv;
import appeng.client.me.SlotDisconnected;
import appeng.container.implementations.ContainerInterfaceTerminal;
import appeng.container.implementations.ContainerWirelessInterfaceTerminal;
import appeng.container.slot.AppEngSlot;
import appeng.core.AEConfig;
import appeng.core.AppEng;
Expand Down Expand Up @@ -127,7 +128,7 @@ public GuiInterfaceTerminal(final InventoryPlayer inventoryPlayer, final PartInt
}

public GuiInterfaceTerminal(final InventoryPlayer inventoryPlayer, final WirelessTerminalGuiObject guiObject) {
super(new ContainerInterfaceTerminal(inventoryPlayer, guiObject));
super(new ContainerWirelessInterfaceTerminal(inventoryPlayer, guiObject));

final GuiScrollbar scrollbar = new GuiScrollbar();
this.setScrollBar(scrollbar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public ContainerInterfaceTerminal(final InventoryPlayer ip, final PartInterfaceT
this.bindPlayerInventory(ip, 0, 0);
}

public ContainerInterfaceTerminal(final InventoryPlayer ip, final WirelessTerminalGuiObject guiObject) {
public ContainerInterfaceTerminal(final InventoryPlayer ip, final WirelessTerminalGuiObject guiObject, boolean bindInventory) {
super(ip, guiObject);

if (Platform.isServer()) {
Expand All @@ -98,7 +98,9 @@ public ContainerInterfaceTerminal(final InventoryPlayer ip, final WirelessTermin
}
}

this.bindPlayerInventory(ip, 0, 0);
if (bindInventory) {
this.bindPlayerInventory(ip, 0, 0);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ContainerWirelessInterfaceTerminal extends ContainerInterfaceTermin
private int ticks = 0;

public ContainerWirelessInterfaceTerminal(InventoryPlayer ip, WirelessTerminalGuiObject guiObject) {
super(ip, guiObject);
super(ip, guiObject,false);

if (guiObject != null) {
final int slotIndex = guiObject.getInventorySlot();
Expand All @@ -28,10 +28,12 @@ public ContainerWirelessInterfaceTerminal(InventoryPlayer ip, WirelessTerminalGu
}
this.slot = slotIndex;
} else {
this.slot = -1;
this.lockPlayerInventorySlot(ip.currentItem);
this.slot = -1;
}

this.bindPlayerInventory(ip,0,0);

this.wirelessTerminalGUIObject = guiObject;
}

Expand Down

0 comments on commit 0f3af05

Please sign in to comment.