Added a priority to IAEPowerStorage (#4473)

Added a priority to IAEPowerStorage
This commit is contained in:
yueh
2020-07-18 18:06:05 +02:00
committed by GitHub
parent d79c0f642c
commit 4a289470e2
5 changed files with 54 additions and 6 deletions
@@ -36,8 +36,10 @@ import appeng.util.SettingsFrom;
public class EnergyCellTileEntity extends AENetworkTileEntity implements IAEPowerStorage {
private static final double MAX_STORED = 200000.0;
private double internalCurrentPower = 0.0;
private double internalMaxPower = 200000.0;
private double internalMaxPower = MAX_STORED;
private byte currentMeta = -1;
@@ -179,6 +181,11 @@ public class EnergyCellTileEntity extends AENetworkTileEntity implements IAEPowe
return pm.divide(this.extractAEPower(pm.multiply(amt), mode));
}
@Override
public int getPriority() {
return 200;
}
private double extractAEPower(double amt, final Actionable mode) {
if (mode == Actionable.SIMULATE) {
if (this.internalCurrentPower > amt) {
@@ -218,4 +225,5 @@ public class EnergyCellTileEntity extends AENetworkTileEntity implements IAEPowe
void setInternalMaxPower(final double internalMaxPower) {
this.internalMaxPower = internalMaxPower;
}
}