diff options
author | Conutik <60240193+Conutik@users.noreply.github.com> | 2024-04-19 22:18:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-19 21:18:12 +0200 |
commit | a8c20dd11db06bba7166cd0014cbdab807fcad9f (patch) | |
tree | 89b9607b7e0dee0e791fabc0f51c355cfdadb264 /src | |
parent | e33f1ff77b5cda352abd3d86c90b04510c5bb107 (diff) | |
download | skyhanni-a8c20dd11db06bba7166cd0014cbdab807fcad9f.tar.gz skyhanni-a8c20dd11db06bba7166cd0014cbdab807fcad9f.tar.bz2 skyhanni-a8c20dd11db06bba7166cd0014cbdab807fcad9f.zip |
[Feature] Added support for calculations in gfs (#1493)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt | 8 |
1 files changed, 4 insertions, 4 deletions
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(':', '-') |