control heuristic

This commit is contained in:
Leijurv 2018-08-17 18:18:37 -07:00
parent fb61b47fb2
commit bd40c9709d
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -126,6 +126,16 @@ public class ExampleBaritoneControl extends Behavior {
event.cancel();
return;
}
if (msg.toLowerCase().startsWith("heuristic")) {
try {
double d = Double.parseDouble(msg.substring("heuristic".length()).trim());
Baritone.settings().costHeuristic.value = d;
} catch (NumberFormatException e) {
displayChatMessageRaw("Couldn't parse value");
}
event.cancel();
return;
}
List<Settings.Setting<Boolean>> toggleable = Baritone.settings().getByValueType(Boolean.class);
for (Settings.Setting<Boolean> setting : toggleable) {
if (msg.equalsIgnoreCase(setting.getName())) {