From 7c4ad1049ec2a867f6b11e18cc4b9596c4426437 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 25 Feb 2023 20:05:31 +0700 Subject: [PATCH] sheeesh --- src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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())