Implement canConnectEnergy so RF cables don't connect when they shouldn't

This commit is contained in:
Ben Spiers 2014-08-06 02:49:45 +01:00
parent 12215490f0
commit a865a19340

View file

@ -288,7 +288,16 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
@Method(modid = "CoFHAPI|energy")
public boolean canConnectEnergy(ForgeDirection from)
{
return true;
if(redstoneReactive && world().isBlockIndirectlyGettingPowered(x(), y(), z()))
{
return false;
}
testingSide = from;
boolean unblocked = tile().canReplacePart(this, this);
testingSide = null;
return unblocked;
}
@Override