From 24da012903b57a21215b8d13e9a04a735ce55b60 Mon Sep 17 00:00:00 2001 From: reb0rt <37573784+reb0rt@users.noreply.github.com> Date: Sun, 18 Aug 2019 13:04:39 +1000 Subject: [PATCH] Stop parseGoal from removing the last argument isNumeric returns false if the input is anything other than a positive integer. This meant that baritone wouldn't properly set goals if they ended in anything other than a positive integer. --- src/api/java/baritone/api/utils/ExampleBaritoneControl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java index 7a90f1be..76849dae 100644 --- a/src/api/java/baritone/api/utils/ExampleBaritoneControl.java +++ b/src/api/java/baritone/api/utils/ExampleBaritoneControl.java @@ -50,7 +50,7 @@ import net.minecraft.world.chunk.Chunk; import java.nio.file.Path; import java.util.*; -import static org.apache.commons.lang3.StringUtils.isNumeric; +import static org.apache.commons.lang3.math.NumberUtils.isCreatable; public class ExampleBaritoneControl implements Helper, AbstractGameEventListener { private static final String COMMAND_PREFIX = "#"; @@ -694,7 +694,7 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener BetterBlockPos playerFeet = ctx.playerFeet(); int length = params.length - 1; // length has to be smaller when a dimension parameter is added - if (params.length < 1 || (isNumeric(params[params.length - 1]) || params[params.length - 1].startsWith("~"))) { + if (params.length < 1 || (isCreatable(params[params.length - 1]) || params[params.length - 1].startsWith("~"))) { length = params.length; } switch (length) {