Added null check to Power pipes.
This commit is contained in:
parent
b4a00eeedd
commit
f1d16b975e
1 changed files with 9 additions and 4 deletions
|
@ -14,6 +14,7 @@ import buildcraft.BuildCraftTransport;
|
||||||
import buildcraft.api.core.Orientations;
|
import buildcraft.api.core.Orientations;
|
||||||
import buildcraft.api.core.SafeTimeTracker;
|
import buildcraft.api.core.SafeTimeTracker;
|
||||||
import buildcraft.api.gates.ITrigger;
|
import buildcraft.api.gates.ITrigger;
|
||||||
|
import buildcraft.api.power.IPowerProvider;
|
||||||
import buildcraft.api.power.IPowerReceptor;
|
import buildcraft.api.power.IPowerReceptor;
|
||||||
import buildcraft.core.DefaultProps;
|
import buildcraft.core.DefaultProps;
|
||||||
import buildcraft.core.IMachine;
|
import buildcraft.core.IMachine;
|
||||||
|
@ -101,7 +102,10 @@ public class PipeTransportPower extends PipeTransport {
|
||||||
} else if (tiles[j] instanceof IPowerReceptor) {
|
} else if (tiles[j] instanceof IPowerReceptor) {
|
||||||
IPowerReceptor pow = (IPowerReceptor) tiles[j];
|
IPowerReceptor pow = (IPowerReceptor) tiles[j];
|
||||||
|
|
||||||
pow.getPowerProvider().receiveEnergy((float) watts, orientations[j].reverse());
|
IPowerProvider prov = pow.getPowerProvider();
|
||||||
|
|
||||||
|
if(prov != null) {
|
||||||
|
prov.receiveEnergy((float) watts, orientations[j].reverse());
|
||||||
|
|
||||||
displayPower[j] += watts / 2F;
|
displayPower[j] += watts / 2F;
|
||||||
displayPower[i] += watts / 2F;
|
displayPower[i] += watts / 2F;
|
||||||
|
@ -112,6 +116,7 @@ public class PipeTransportPower extends PipeTransport {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Compute the tiles requesting energy that are not pipes
|
// Compute the tiles requesting energy that are not pipes
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue