Compare commits

..
3 Commits
Author SHA1 Message Date
Martin Robertz 27759a5343 Update BS+SA 2022-09-16 12:06:30 +02:00
Martin Robertz 4c9e6da515 Merge remote-tracking branch 'asdflj/master' into dev 2022-09-16 12:05:42 +02:00
asdflj f36cba7094 fix crafting terminal crash
fix in crafting terminal use hot key to transfer current crafting terminal item to craft slot crash
2022-09-16 16:56:24 +08:00
2 changed files with 11 additions and 12 deletions

No files matched your search

@@ -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));
}
}