From e2a300259c20b5df33a6e3945dfd390ff57fa22a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 16 Apr 2023 10:05:46 +0700 Subject: [PATCH] Swap execution order in moveEnergy --- 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 124338e45..414a3fbcc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/Ext.kt @@ -365,8 +365,8 @@ fun moveEnergy(source: IEnergyStorage, destination: IEnergyStorage, amount: Deci return extracted } - val received = destination.receiveEnergy(extracted, false) - return if (ignoreFlowRestrictions && source is IMatteryEnergyStorage) source.extractEnergy(received, false) else source.extractEnergy(received, false) + val extracted = if (ignoreFlowRestrictions && source is IMatteryEnergyStorage) source.extractEnergy(received, false) else source.extractEnergy(received, false) + return destination.receiveEnergy(extracted, false) } } }