Fixed connecting only to wires sitting on the face

This commit is contained in:
Calclavia 2013-12-23 11:19:41 +08:00
parent 5e8dc4da03
commit 18b3219a61

View file

@ -101,12 +101,20 @@ public class TraitConductor extends TileMultipart implements IConductor
@Override @Override
public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive)
{ {
// TODO: Allow floor connections to also receive this. /**
TMultiPart part = this.partMap(from.ordinal()); * Try out different sides to try to inject energy into.
*/
if (this.interfaces.contains(part)) 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; return 0;