From 5daaaf5282455ddda314fd3e030909efbc41445d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Thu, 29 Nov 2018 15:33:35 -0800 Subject: [PATCH] add settings reset command --- src/api/java/baritone/api/Settings.java | 6 ++++++ src/main/java/baritone/utils/ExampleBaritoneControl.java | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index a835ed73..1a3fef08 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -553,6 +553,12 @@ public class Settings { */ public final List> allSettings; + public void reset() { + for (Setting setting : allSettings) { + setting.value = setting.defaultValue; + } + } + public class Setting { public T value; public final T defaultValue; diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index 2c112ee3..958af776 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -277,6 +277,11 @@ public class ExampleBaritoneControl extends Behavior implements Helper { }); return true; } + if (msg.equals("reset")) { + Baritone.settings().reset(); + logDirect("Baritone settings reset"); + return true; + } if (msg.startsWith("followplayers")) { baritone.getFollowProcess().follow(EntityPlayer.class::isInstance); // O P P A logDirect("Following any players");