Merge remote-tracking branch 'remotes/origin/patch-powerRequest' into patch-renderPipe
closes #666
This commit is contained in:
commit
4a8f1654c5
2 changed files with 10 additions and 3 deletions
|
@ -407,7 +407,9 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
|
|||
|
||||
@Override
|
||||
public int powerRequest() {
|
||||
return getPowerProvider().getMaxEnergyReceived();
|
||||
if (BlockGenericPipe.isValid(pipe) && pipe instanceof IPowerReceptor)
|
||||
return ((IPowerReceptor) pipe).powerRequest();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -114,9 +114,14 @@ public class PipePowerWood extends Pipe implements IPowerReceptor {
|
|||
energyToRemove = 1;
|
||||
}
|
||||
|
||||
float energyUsed = powerProvider.useEnergy(1, energyToRemove, true);
|
||||
float energyUsable = powerProvider.useEnergy(1, energyToRemove, false);
|
||||
|
||||
trans.receiveEnergy(o.getOpposite(), energyUsed);
|
||||
float energySend = Math.min(energyUsable, ((PipeTransportPower)transport).powerQuery[o.ordinal()]);
|
||||
if(energySend > 0)
|
||||
{
|
||||
trans.receiveEnergy(o.getOpposite(), energySend);
|
||||
powerProvider.useEnergy(1, energySend, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue