From fc63c16ee0b0d55f2dbd054dd216141077be5085 Mon Sep 17 00:00:00 2001 From: Logan Darklock Date: Sat, 7 Sep 2019 00:21:54 -0700 Subject: [PATCH] initialize chat control only once ever --- src/main/java/baritone/Baritone.java | 3 --- src/main/java/baritone/BaritoneProvider.java | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/Baritone.java b/src/main/java/baritone/Baritone.java index 4b00c797..7f70bbea 100755 --- a/src/main/java/baritone/Baritone.java +++ b/src/main/java/baritone/Baritone.java @@ -135,9 +135,6 @@ public class Baritone implements IBaritone { } this.initialized = true; - - DefaultCommands.COMMANDS.forEach(CommandManager.REGISTRY::register); - new BaritoneChatControl(this); } @Override diff --git a/src/main/java/baritone/BaritoneProvider.java b/src/main/java/baritone/BaritoneProvider.java index 44715f4c..9fdd0489 100644 --- a/src/main/java/baritone/BaritoneProvider.java +++ b/src/main/java/baritone/BaritoneProvider.java @@ -20,7 +20,10 @@ package baritone; import baritone.api.IBaritone; import baritone.api.IBaritoneProvider; import baritone.api.cache.IWorldScanner; +import baritone.api.utils.command.BaritoneChatControl; +import baritone.api.utils.command.manager.CommandManager; import baritone.cache.WorldScanner; +import baritone.utils.command.defaults.DefaultCommands; import java.util.Collections; import java.util.List; @@ -34,6 +37,11 @@ public final class BaritoneProvider implements IBaritoneProvider { private final Baritone primary = new Baritone(); private final List all = Collections.singletonList(primary); + { + DefaultCommands.COMMANDS.forEach(CommandManager.REGISTRY::register); + new BaritoneChatControl(primary); + } + @Override public IBaritone getPrimaryBaritone() { return primary;