This commit is contained in:
DBotThePony 2023-02-25 20:05:31 +07:00
parent f5840c4ca1
commit 7c4ad1049e
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -37,7 +37,7 @@ internal fun IEnergyStorage.receiveEnergy(amount: Decimal, simulate: Boolean): D
if (this is IMatteryEnergyStorage) if (this is IMatteryEnergyStorage)
return receiveEnergyChecked(amount, simulate) return receiveEnergyChecked(amount, simulate)
if (!amount.isPositive) if (amount.isNegative)
throw IllegalArgumentException("Negative energy: $amount") throw IllegalArgumentException("Negative energy: $amount")
if (!canReceive()) if (!canReceive())
@ -56,7 +56,7 @@ internal fun IEnergyStorage.extractEnergy(amount: Decimal, simulate: Boolean): D
if (this is IMatteryEnergyStorage) if (this is IMatteryEnergyStorage)
return extractEnergyChecked(amount, simulate) return extractEnergyChecked(amount, simulate)
if (!amount.isPositive) if (amount.isNegative)
throw IllegalArgumentException("Negative energy: $amount") throw IllegalArgumentException("Negative energy: $amount")
if (!canExtract()) if (!canExtract())