Fixed connecting only to wires sitting on the face
This commit is contained in:
parent
5e8dc4da03
commit
18b3219a61
1 changed files with 13 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue