Compare commits

...
4 Commits
Author SHA1 Message Date
Martin Robertz 0242be58a9 Merge pull request #24 from GTNewHorizons/hotfix-infinity-booster
Fix infinity booster not working anymore
2022-09-25 10:51:00 +02:00
Raven Szewczyk c0afb9eb8f Fix infinity booster not working anymore
The isBoosterInstalled() function was using the wrong slot index after the shift to fix it getting removed from the WCT easily
2022-09-25 09:45:52 +01:00
Martin Robertz 07fd1eef26 Merge pull request #23 from GTNewHorizons/hotfix-infinity-booster
Prevent the infinity booster from getting pulled out by accident
2022-09-19 13:26:38 +02:00
Raven Szewczyk 5c4d3d11c9 Prevent the infinity booster from getting pulled out by accident 2022-09-17 11:03:46 +01:00
@@ -29,7 +29,6 @@ import appeng.container.AEBaseContainer;
import appeng.container.ContainerNull;
import appeng.container.slot.AppEngCraftingSlot;
import appeng.container.slot.AppEngSlot;
import appeng.container.slot.NullSlot;
import appeng.container.slot.SlotCraftingMatrix;
import appeng.container.slot.SlotCraftingTerm;
import appeng.container.slot.SlotDisabled;
@@ -113,7 +112,7 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
public ItemStack[] craftMatrixInventory;
private final World worldObj;
private final EntityPlayer player;
public static final int HOTBAR_START = 1,
public static final int HOTBAR_START = 2,
HOTBAR_END = HOTBAR_START + 8,
INV_START = HOTBAR_END + 1,
INV_END = INV_START + 26,
@@ -124,12 +123,11 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
CRAFT_RESULT = CRAFT_GRID_END + 1,
VIEW_CELL_START = CRAFT_RESULT + 1,
VIEW_CELL_END = VIEW_CELL_START + 4,
BOOSTER_INDEX = 0,
BOOSTER_INDEX = 1,
MAGNET_INDEX = VIEW_CELL_END + 1;
public static int CRAFTING_SLOT_X_POS = 80, CRAFTING_SLOT_Y_POS = 83;
private SlotBooster boosterSlot;
private final SlotMagnet magnetSlot;
private NullSlot nullSlot;
private final Slot[] hotbarSlot;
private final Slot[] inventorySlot;
private final SlotArmor[] armorSlot;
@@ -214,12 +212,14 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
this.monitor = null;
}
// Dummy slot at index 0 to work around ME slots all having their slot number set to 0.
this.addSlotToContainer(new SlotInaccessible(new AppEngInternalInventory(null, 1), 0, -1000, -1000));
if (Reference.WCT_BOOSTER_ENABLED) {
boosterSlot = new SlotBooster(this.boosterInventory, 0, 134, -20);
this.addSlotToContainer(boosterSlot);
} else {
nullSlot = new NullSlot();
this.addSlotToContainer(nullSlot);
this.addSlotToContainer(new SlotInaccessible(new AppEngInternalInventory(null, 1), 0, -1000, -1000));
}
// Add hotbar slots
@@ -822,16 +822,14 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
}
public boolean isBoosterInstalled() {
Slot slot = getSlotFromInventory(this.boosterInventory, BOOSTER_INDEX);
Slot slot = getSlotFromInventory(this.boosterInventory, 0);
if (slot == null) {
return false;
}
boolean hasStack =
getSlotFromInventory(this.boosterInventory, BOOSTER_INDEX).getHasStack();
boolean hasStack = getSlotFromInventory(this.boosterInventory, 0).getHasStack();
if (hasStack) {
Item boosterSlotContents = getSlotFromInventory(this.boosterInventory, BOOSTER_INDEX)
.getStack()
.getItem();
Item boosterSlotContents =
getSlotFromInventory(this.boosterInventory, 0).getStack().getItem();
return boosterSlotContents instanceof ItemInfinityBooster;
}
return false;