From 18b3219a61ce05c4e451d965473c662cc31b4a68 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Mon, 23 Dec 2013 11:19:41 +0800 Subject: [PATCH] Fixed connecting only to wires sitting on the face --- .../wire/part/TraitConductor.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/resonantinduction/wire/part/TraitConductor.java b/src/resonantinduction/wire/part/TraitConductor.java index 01e5fb26..d83a2a44 100644 --- a/src/resonantinduction/wire/part/TraitConductor.java +++ b/src/resonantinduction/wire/part/TraitConductor.java @@ -101,12 +101,20 @@ public class TraitConductor extends TileMultipart implements IConductor @Override public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) { - // TODO: Allow floor connections to also receive this. - TMultiPart part = this.partMap(from.ordinal()); - - if (this.interfaces.contains(part)) + /** + * Try out different sides to try to inject energy into. + */ + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - ((IConductor) part).onReceiveEnergy(from, receive, doReceive); + if (dir != from.getOpposite() && dir != from) + { + TMultiPart part = this.partMap(dir.ordinal()); + + if (this.interfaces.contains(part)) + { + return ((IConductor) part).onReceiveEnergy(from, receive, doReceive); + } + } } return 0;