close wireless terminals if they run out of power instead of not working

This commit is contained in:
PrototypeTrousers
2023-02-14 19:10:42 -03:00
parent ede2b4ce25
commit 36d94a17aa
4 changed files with 58 additions and 7 deletions
@@ -171,9 +171,16 @@ public class ContainerMEPortableFluidCell extends AEBaseContainer implements IAE
// drain 1 ae t
this.ticks++;
if (this.ticks > 10) {
double power = this.wirelessTerminalGUIObject.extractAEPower(this.getPowerMultiplier() * this.ticks, Actionable.MODULATE, PowerMultiplier.CONFIG);
double ext = this.wirelessTerminalGUIObject.extractAEPower(this.getPowerMultiplier() * this.ticks, Actionable.MODULATE, PowerMultiplier.CONFIG);
if (ext < this.getPowerMultiplier() * this.ticks) {
if (Platform.isServer() && this.isValidContainer()) {
this.getPlayerInv().player.sendMessage(PlayerMessages.DeviceNotPowered.get());
}
this.setValidContainer(false);
}
this.ticks = 0;
this.hasPower = power > 0.001;
this.hasPower = ext > 0.001;
}
if (!this.wirelessTerminalGUIObject.rangeCheck()) {