add settings reset command

This commit is contained in:
Leijurv 2018-11-29 15:33:35 -08:00
parent 6f7729e34e
commit 5daaaf5282
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 11 additions and 0 deletions

View File

@ -553,6 +553,12 @@ public class Settings {
*/
public final List<Setting<?>> allSettings;
public void reset() {
for (Setting setting : allSettings) {
setting.value = setting.defaultValue;
}
}
public class Setting<T> {
public T value;
public final T defaultValue;

View File

@ -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");