From d8f2f44b5ff2e1d66e0a77ccc1a43ae885945789 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 8 Sep 2022 17:11:53 +0700 Subject: [PATCH] Do not allow energy go through if we have more than 1 item in stack --- .../ru/dbotthepony/mc/otm/capability/EnergyStorageImpl.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/EnergyStorageImpl.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/EnergyStorageImpl.kt index f7d19ca9c..d863cc37c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/EnergyStorageImpl.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/EnergyStorageImpl.kt @@ -74,7 +74,7 @@ sealed class ItemEnergyStorageImpl( } override fun extractEnergyInner(howMuch: ImpreciseFraction, simulate: Boolean): ImpreciseFraction { - if (!howMuch.isPositive) + if (!howMuch.isPositive || itemStack.count != 1) return ImpreciseFraction.ZERO @Suppress("NAME_SHADOWING") @@ -101,7 +101,7 @@ sealed class ItemEnergyStorageImpl( } override fun receiveEnergyInner(howMuch: ImpreciseFraction, simulate: Boolean): ImpreciseFraction { - if (!howMuch.isPositive) + if (!howMuch.isPositive || itemStack.count != 1) return ImpreciseFraction.ZERO @Suppress("NAME_SHADOWING")