Opts
This commit is contained in:
parent
73aa6260a6
commit
2d281c56d1
1 changed files with 12 additions and 8 deletions
|
@ -80,21 +80,25 @@ public final class PowerProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyPerdition() {
|
private void applyPerdition() {
|
||||||
|
if (powerLoss > 0) {
|
||||||
TileEntity tile = (TileEntity) receptor;
|
TileEntity tile = (TileEntity) receptor;
|
||||||
if (powerLoss > 0 && energyLossTracker.markTimeIfDelay(tile.worldObj, powerLossRegularity)) {
|
if (energyLossTracker.markTimeIfDelay(tile.worldObj, powerLossRegularity)) {
|
||||||
energyStored -= powerLoss;
|
energyStored -= powerLoss;
|
||||||
if (energyStored < 0) {
|
if (energyStored < 0) {
|
||||||
energyStored = 0;
|
energyStored = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void applyWork() {
|
private void applyWork() {
|
||||||
|
if (energyStored >= minActivationEnergy) {
|
||||||
TileEntity tile = (TileEntity) receptor;
|
TileEntity tile = (TileEntity) receptor;
|
||||||
if (energyStored >= minActivationEnergy && doWorkTracker.markTimeIfDelay(tile.worldObj, 1)) {
|
if (doWorkTracker.markTimeIfDelay(tile.worldObj, 1)) {
|
||||||
receptor.doWork(this);
|
receptor.doWork(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public float useEnergy(float min, float max, boolean doUse) {
|
public float useEnergy(float min, float max, boolean doUse) {
|
||||||
float result = 0;
|
float result = 0;
|
||||||
|
|
Loading…
Reference in a new issue