mirror of
https://github.com/GTNewHorizons/WirelessCraftingTerminal.git
synced 2026-11-26 06:42:55 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27759a5343 | ||
|
|
4c9e6da515 | ||
|
|
f36cba7094 |
No files matched your search
+4
-12
@@ -224,12 +224,7 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
|
||||
|
||||
// Add hotbar slots
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
if (player.inventory.getStackInSlot(i) != null
|
||||
&& player.inventory.getStackInSlot(i).getItem() == this.thisItem) {
|
||||
hotbarSlot[i] = new SlotDisabled(this.inventoryPlayer, i, i * 18 + 8, 58);
|
||||
} else {
|
||||
hotbarSlot[i] = new SlotPlayerHotBar(this.inventoryPlayer, i, i * 18 + 8, 58);
|
||||
}
|
||||
hotbarSlot[i] = new SlotPlayerHotBar(this.inventoryPlayer, i, i * 18 + 8, 58);
|
||||
this.addSlotToContainer(hotbarSlot[i]);
|
||||
}
|
||||
|
||||
@@ -238,12 +233,7 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
|
||||
// Add player inventory slots
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
if (player.inventory.getStackInSlot(j + i * 9 + 9) != null
|
||||
&& player.inventory.getStackInSlot(j + i * 9 + 9).getItem() == this.thisItem) {
|
||||
inventorySlot[k] = new SlotDisabled(this.inventoryPlayer, j + i * 9 + 9, j * 18 + 8, i * 18);
|
||||
} else {
|
||||
inventorySlot[k] = new SlotPlayerInv(this.inventoryPlayer, j + i * 9 + 9, j * 18 + 8, i * 18);
|
||||
}
|
||||
inventorySlot[k] = new SlotPlayerInv(this.inventoryPlayer, j + i * 9 + 9, j * 18 + 8, i * 18);
|
||||
this.addSlotToContainer(inventorySlot[k]);
|
||||
k++;
|
||||
}
|
||||
@@ -1327,6 +1317,8 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
|
||||
&& getSlot(slot) != null
|
||||
&& getSlot(slot).getStack() == RandomUtils.getWirelessTerm(player.inventory)) {
|
||||
return null;
|
||||
} else if (player.inventory.currentItem == button && flag == 2) {
|
||||
return null;
|
||||
}
|
||||
return super.slotClick(slot, button, flag, player);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
|
||||
@@ -51,6 +51,13 @@ public class KeybindHandler {
|
||||
IWirelessCraftingTerminalItem wirelessTerm = (IWirelessCraftingTerminalItem) is.getItem();
|
||||
if (wirelessTerm != null && wirelessTerm.isWirelessCraftingEnabled(is)) {
|
||||
if (!FMLClientHandler.instance().isGUIOpen(GuiWirelessCraftingTerminal.class)) {
|
||||
for (int i = 0; i < p.inventory.mainInventory.length; ++i) {
|
||||
if (p.inventory.mainInventory[i] != null
|
||||
&& p.inventory.mainInventory[i].getItem() == wirelessTerm) {
|
||||
p.inventory.currentItem = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
NetworkHandler.instance.sendToServer(new PacketOpenGui(Reference.GUI_WCT));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user