diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2021-12-03 14:29:00 +0800 |
---|---|---|
committer | Glease <4586901+Glease@users.noreply.github.com> | 2021-12-04 00:13:52 +0800 |
commit | 8c029eab281e8612da2dd12f8b0d61ee8c8417a2 (patch) | |
tree | 332db14831b285b1fa5f08258e59d642c676428a /src/main/java/gregtech/api/metatileentity/implementations | |
parent | 92c78f346995f7140902f9719daa89d427f61a04 (diff) | |
download | GT5-Unofficial-8c029eab281e8612da2dd12f8b0d61ee8c8417a2.tar.gz GT5-Unofficial-8c029eab281e8612da2dd12f8b0d61ee8c8417a2.tar.bz2 GT5-Unofficial-8c029eab281e8612da2dd12f8b0d61ee8c8417a2.zip |
Make machine reconfiguration interface a little nicer
also tweaked the API a little for GT++ conf circuits and bartworks circuit programmer
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index 8f77b6ac5a..92bf07f379 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -139,6 +139,13 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B } @Override + public void setInventorySlotContents(int aIndex, ItemStack aStack) { + if (allowSelectCircuit() && aIndex == getCircuitSlot() && aStack != null && aStack.stackSize != 0) + aStack = GT_Utility.copyAmount(0, aStack); + super.setInventorySlotContents(aIndex, aStack); + } + + @Override public GT_MetaTileEntity_Cleanroom getCallbackBase() { return this.mCleanroom; } @@ -210,7 +217,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B @Override public boolean isValidSlot(int aIndex) { - return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length; + return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != getCircuitSlot() && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length; } @Override @@ -871,7 +878,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B * This list is unmodifiable. Its elements are not supposed to be modified in any way! */ public List<ItemStack> getConfigurationCircuits() { - return GregTech_API.getConfigurationCircuitList(); + return GregTech_API.getConfigurationCircuitList(mTier); } /** |