From cb665fb9fbe62bf566c04c086912131742112e1f Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Sun, 19 Jan 2025 18:06:18 -0500 Subject: [PATCH] Add ME hatch 'connect to any side' copying --- .../common/building/GTAnalysisResult.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/recursive_pineapple/matter_manipulator/common/building/GTAnalysisResult.java b/src/main/java/com/recursive_pineapple/matter_manipulator/common/building/GTAnalysisResult.java index bd4c28e..f11cde6 100644 --- a/src/main/java/com/recursive_pineapple/matter_manipulator/common/building/GTAnalysisResult.java +++ b/src/main/java/com/recursive_pineapple/matter_manipulator/common/building/GTAnalysisResult.java @@ -17,6 +17,7 @@ import gregtech.api.enums.VoidingMode; import gregtech.api.interfaces.IConfigurationCircuitSupport; import gregtech.api.interfaces.IDataCopyable; +import gregtech.api.interfaces.IMEConnectable; import gregtech.api.interfaces.metatileentity.IConnectable; import gregtech.api.interfaces.metatileentity.IFluidLockable; import gregtech.api.interfaces.metatileentity.IItemLockable; @@ -81,6 +82,7 @@ public class GTAnalysisResult implements ITileAnalysisIntegration { private static final short GT_MULTI_BATCH_MODE = (short) (0b1 << counter++); private static final short GT_MULTI_INPUT_SEPARATION = (short) (0b1 << counter++); private static final short GT_MULTI_RECIPE_LOCK = (short) (0b1 << counter++); + private static final short GT_ME_CONNECT_ALL_SIDES = (short) (0b1 << counter++); private static final GTAnalysisResult NO_OP = new GTAnalysisResult(); @@ -247,6 +249,10 @@ public GTAnalysisResult(IGregTechTileEntity igte) { if (mte instanceof MTEHatchDynamoTunnel dynamo) { mAmperes = dynamo.Amperes; } + + if (mte instanceof IMEConnectable me && me.connectsToAllSides()) { + mGTFlags |= GT_ME_CONNECT_ALL_SIDES; + } } @Override @@ -436,6 +442,10 @@ public boolean apply(IBlockApplyContext ctx) { if (mte instanceof MTEHatchDynamoTunnel dynamo) { dynamo.Amperes = MMUtils.clamp(mAmperes, 0, dynamo.maxAmperes); } + + if (mte instanceof IMEConnectable me) { + me.setConnectsToAllSides((mGTFlags & GT_ME_CONNECT_ALL_SIDES) != 0); + } } return true;