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/api/metatileentity/MetaTileEntity.java | |
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/api/metatileentity/MetaTileEntity.java')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/MetaTileEntity.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 7d4cbae063..13ea66e7d2 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -11,6 +11,7 @@ import gnu.trove.list.TIntList; import gnu.trove.list.array.TIntArrayList; import gregtech.api.GregTech_API; import gregtech.api.enums.SoundResource; +import gregtech.api.interfaces.metatileentity.IConfigurationCircuitSupport; import gregtech.api.interfaces.metatileentity.IMachineCallback; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -710,7 +711,15 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac @Override public void setInventorySlotContents(int aIndex, ItemStack aStack) { markDirty(); - if (aIndex >= 0 && aIndex < mInventory.length) mInventory[aIndex] = aStack; + if (this instanceof IConfigurationCircuitSupport) { + IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport)this; + if (ccs.allowSelectCircuit() && aIndex == ccs.getCircuitSlot() && aStack != null) { + mInventory[aIndex] = GT_Utility.copyAmount(0, aStack); + return; + } + } + if (aIndex >= 0 && aIndex < mInventory.length) + mInventory[aIndex] = aStack; } @Override @@ -1047,8 +1056,7 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac IEnergyGrid eg = getProxy().getNode().getGrid().getCache(IEnergyGrid.class); if (!eg.isNetworkPowered()) return "(power)"; - } - catch(Throwable ex) { + } catch(Throwable ex) { ex.printStackTrace(); } return ""; |