Merge pull request #1848 from Prototik/energy-converter-crash
Energy converter crash
This commit is contained in:
commit
ae43e9cdb9
1 changed files with 3 additions and 0 deletions
|
@ -139,6 +139,9 @@ public class TileEnergyConverter extends TileBuildCraft implements IPowerRecepto
|
|||
if (tile instanceof IPowerReceptor && mjStored > 0) {
|
||||
IPowerReceptor receptor = (IPowerReceptor) tile;
|
||||
PowerHandler.PowerReceiver powerReceiver = receptor.getPowerReceiver(side.getOpposite());
|
||||
if (powerReceiver == null) {
|
||||
continue;
|
||||
}
|
||||
double wantToUse = Math.min(mjStored, powerReceiver.getMaxEnergyReceived());
|
||||
if (wantToUse > powerReceiver.getMinEnergyReceived()) {
|
||||
powerReceiver.receiveEnergy(PowerHandler.Type.MACHINE, wantToUse, side);
|
||||
|
|
Loading…
Reference in a new issue