Make the prefix optional

This commit is contained in:
Brady 2018-08-23 21:01:35 -05:00
parent 93de55318f
commit 71ce9cd901
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 6 additions and 1 deletions

View File

@ -241,6 +241,11 @@ public class Settings {
*/ */
public Setting<Boolean> pathThroughCachedOnly = new Setting<>(false); public Setting<Boolean> pathThroughCachedOnly = new Setting<>(false);
/**
* Whether or not to use the "#" command prefix
*/
public Setting<Boolean> prefix = new Setting<>(false);
public final Map<String, Setting<?>> byLowerName; public final Map<String, Setting<?>> byLowerName;
public final List<Setting<?>> allSettings; public final List<Setting<?>> allSettings;

View File

@ -55,7 +55,7 @@ public class ExampleBaritoneControl extends Behavior {
return; return;
} }
String msg = event.getMessage(); String msg = event.getMessage();
if (!msg.startsWith("#")) if (Baritone.settings().prefix.get() && !msg.startsWith("#"))
return; return;
msg = msg.substring(1); msg = msg.substring(1);