From a8c20dd11db06bba7166cd0014cbdab807fcad9f Mon Sep 17 00:00:00 2001 From: Conutik <60240193+Conutik@users.noreply.github.com> Date: Fri, 19 Apr 2024 22:18:12 +0300 Subject: [Feature] Added support for calculations in gfs (#1493) --- src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt index 9d3a6253a..ba0e334a0 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt @@ -23,6 +23,7 @@ import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import io.github.moulberry.notenoughupdates.util.Calculator import net.minecraft.inventory.Slot import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.Deque @@ -165,11 +166,10 @@ object GetFromSackAPI { return CommandResult.WRONG_ARGUMENT to null } - val amountString = args.last() + var amountString = args.last() + amountString = Calculator.calculate(amountString).toString() - if (!amountString.isInt()) { - return CommandResult.WRONG_AMOUNT to null - } + if (!amountString.isInt()) return CommandResult.WRONG_AMOUNT to null val itemString = args.dropLast(1).joinToString(" ").uppercase().replace(':', '-') -- cgit