initialize chat control only once ever

This commit is contained in:
Logan Darklock 2019-09-07 00:21:54 -07:00
parent 1bb4e44b71
commit fc63c16ee0
No known key found for this signature in database
GPG Key ID: B8C37CEDE1AC60EA
2 changed files with 8 additions and 3 deletions

View File

@ -135,9 +135,6 @@ public class Baritone implements IBaritone {
} }
this.initialized = true; this.initialized = true;
DefaultCommands.COMMANDS.forEach(CommandManager.REGISTRY::register);
new BaritoneChatControl(this);
} }
@Override @Override

View File

@ -20,7 +20,10 @@ package baritone;
import baritone.api.IBaritone; import baritone.api.IBaritone;
import baritone.api.IBaritoneProvider; import baritone.api.IBaritoneProvider;
import baritone.api.cache.IWorldScanner; import baritone.api.cache.IWorldScanner;
import baritone.api.utils.command.BaritoneChatControl;
import baritone.api.utils.command.manager.CommandManager;
import baritone.cache.WorldScanner; import baritone.cache.WorldScanner;
import baritone.utils.command.defaults.DefaultCommands;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -34,6 +37,11 @@ public final class BaritoneProvider implements IBaritoneProvider {
private final Baritone primary = new Baritone(); private final Baritone primary = new Baritone();
private final List<IBaritone> all = Collections.singletonList(primary); private final List<IBaritone> all = Collections.singletonList(primary);
{
DefaultCommands.COMMANDS.forEach(CommandManager.REGISTRY::register);
new BaritoneChatControl(primary);
}
@Override @Override
public IBaritone getPrimaryBaritone() { public IBaritone getPrimaryBaritone() {
return primary; return primary;