Do not allow energy go through if we have more than 1 item in stack

This commit is contained in:
DBotThePony 2022-09-08 17:11:53 +07:00
parent 5603970654
commit d8f2f44b5f
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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")