diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt index 49063638d..833203473 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt @@ -37,7 +37,7 @@ internal fun IEnergyStorage.receiveEnergy(amount: Decimal, simulate: Boolean): D if (this is IMatteryEnergyStorage) return receiveEnergyChecked(amount, simulate) - if (!amount.isPositive) + if (amount.isNegative) throw IllegalArgumentException("Negative energy: $amount") if (!canReceive()) @@ -56,7 +56,7 @@ internal fun IEnergyStorage.extractEnergy(amount: Decimal, simulate: Boolean): D if (this is IMatteryEnergyStorage) return extractEnergyChecked(amount, simulate) - if (!amount.isPositive) + if (amount.isNegative) throw IllegalArgumentException("Negative energy: $amount") if (!canExtract())