From a09f0cfd164a50510bb1446c7f73e990c01eaf6d Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Sun, 30 Oct 2022 12:45:21 +0100 Subject: [PATCH] fix: universal cable connection to IC2 --- .../common/base/EnergyAcceptorWrapper.java | 5 ++-- .../common/multipart/PartUniversalCable.java | 6 ++--- .../java/mekanism/common/util/CableUtils.java | 25 ++++++++++++------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/main/java/mekanism/common/base/EnergyAcceptorWrapper.java b/src/main/java/mekanism/common/base/EnergyAcceptorWrapper.java index 5ead4daa5..9fd36df50 100644 --- a/src/main/java/mekanism/common/base/EnergyAcceptorWrapper.java +++ b/src/main/java/mekanism/common/base/EnergyAcceptorWrapper.java @@ -4,6 +4,7 @@ import ic2.api.energy.tile.IEnergySink; import mekanism.api.Coord4D; import mekanism.api.MekanismConfig.general; import mekanism.api.energy.IStrictEnergyAcceptor; +import mekanism.common.util.CableUtils; import mekanism.common.util.MekanismUtils; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; @@ -30,9 +31,9 @@ public abstract class EnergyAcceptorWrapper implements IStrictEnergyAcceptor { wrapper = new RFAcceptor((IEnergyReceiver)tileEntity); } - else if(MekanismUtils.useIC2() && tileEntity instanceof IEnergySink) + else if(MekanismUtils.useIC2() && CableUtils.getIC2Tile(tileEntity) instanceof IEnergySink) { - wrapper = new IC2Acceptor((IEnergySink)tileEntity); + wrapper = new IC2Acceptor((IEnergySink)CableUtils.getIC2Tile(tileEntity)); } if(wrapper != null) diff --git a/src/main/java/mekanism/common/multipart/PartUniversalCable.java b/src/main/java/mekanism/common/multipart/PartUniversalCable.java index 70970d683..78846c352 100644 --- a/src/main/java/mekanism/common/multipart/PartUniversalCable.java +++ b/src/main/java/mekanism/common/multipart/PartUniversalCable.java @@ -105,9 +105,9 @@ public class PartUniversalCable extends PartTransmitter 0) @@ -115,7 +115,7 @@ public class PartUniversalCable extends PartTransmitter