diff options
author | repo-alt <wvk17@yandex.ru> | 2022-08-23 19:44:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 18:44:25 +0200 |
commit | 6bef2556c78cbbd6bde0f73a9849ab709590c8bd (patch) | |
tree | 40146cf238d68c281278e7bd0dd5929656479435 /src/main/java/gregtech/common/tileentities | |
parent | 43e283f28747967af991a7dfc36d70124c5be765 (diff) | |
download | GT5-Unofficial-6bef2556c78cbbd6bde0f73a9849ab709590c8bd.tar.gz GT5-Unofficial-6bef2556c78cbbd6bde0f73a9849ab709590c8bd.tar.bz2 GT5-Unofficial-6bef2556c78cbbd6bde0f73a9849ab709590c8bd.zip |
Refactored built-in integrated circuit support (#1284)
* Refactored built-in integrated circuit support
Added built-in integrated circuit to input buses
* fix spacing
Diffstat (limited to 'src/main/java/gregtech/common/tileentities')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java | 21 |
1 files changed, 15 insertions, 6 deletions
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[] { @@ -184,10 +185,20 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch 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; |