From 6bef2556c78cbbd6bde0f73a9849ab709590c8bd Mon Sep 17 00:00:00 2001 From: repo-alt Date: Tue, 23 Aug 2022 19:44:25 +0300 Subject: Refactored built-in integrated circuit support (#1284) * Refactored built-in integrated circuit support Added built-in integrated circuit to input buses * fix spacing --- .../GT_MetaTileEntity_Hatch_InputBus_ME.java | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java index 613e97e911..ec747a79f3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java @@ -24,6 +24,7 @@ import cpw.mods.fml.common.Optional; import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IConfigurationCircuitSupport; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; @@ -34,12 +35,12 @@ import gregtech.common.gui.GT_GUIContainer_InputBus_ME; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH_ACTIVE; -public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch_InputBus { +public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch_InputBus implements IConfigurationCircuitSupport { private static final int SLOT_COUNT = 16; private BaseActionSource requestSource = null; private AENetworkProxy gridProxy = null; - private ItemStack[] shadowInventory = new ItemStack[SLOT_COUNT]; - private int[] savedStackSizes = new int[SLOT_COUNT]; + private final ItemStack[] shadowInventory = new ItemStack[SLOT_COUNT]; + private final int[] savedStackSizes = new int[SLOT_COUNT]; private boolean processingRecipe = false; public GT_MetaTileEntity_Hatch_InputBus_ME(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 1, SLOT_COUNT * 2 + 1, new String[] { @@ -183,11 +184,21 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch @Override public int getCircuitSlot() { return SLOT_COUNT * 2; } + @Override + public int getCircuitSlotX() { + return 80; + } + + @Override + public int getCircuitSlotY() { + return 63; + } + @Override public ItemStack getStackInSlot(int aIndex) { if (!processingRecipe) return super.getStackInSlot(aIndex); - if (aIndex < 0 && aIndex > mInventory.length) + if (aIndex < 0 || aIndex > mInventory.length) return null; if (aIndex >= SLOT_COUNT && aIndex < SLOT_COUNT * 2) //Display slots @@ -274,7 +285,6 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch if (GregTech_API.mAE2 && aIndex >= 0 && aIndex < SLOT_COUNT) { if (aStack == null) { super.setInventorySlotContents(aIndex + SLOT_COUNT, null); - return null; } else { AENetworkProxy proxy = getProxy(); @@ -293,7 +303,6 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch } catch (final GridAccessException ignored) { } - return null; } } return null; -- cgit