From efb316de1475a37fd0047e601d004c8cfcc41b1c Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 5 Feb 2019 18:11:33 -0800 Subject: [PATCH] codacy --- .../java/baritone/utils/ExampleBaritoneControl.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index cca2bf3a..289ff936 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -88,14 +88,12 @@ public class ExampleBaritoneControl extends Behavior implements Helper { @Override public void onSendChatMessage(ChatEvent event) { String msg = event.getMessage(); - if (Baritone.settings().prefixControl.get()) { - if (msg.startsWith(COMMAND_PREFIX)) { - if (!runCommand(msg.substring(COMMAND_PREFIX.length()))) { - logDirect("Invalid command"); - } - event.cancel(); // always cancel if using prefixControl - return; + if (Baritone.settings().prefixControl.get() && msg.startsWith(COMMAND_PREFIX)) { + if (!runCommand(msg.substring(COMMAND_PREFIX.length()))) { + logDirect("Invalid command"); } + event.cancel(); // always cancel if using prefixControl + return; } if (!Baritone.settings().chatControl.get() && !Baritone.settings().removePrefix.get()) { return;