From c169d8f2583f549ec35f68171a4b1b1e2fb045e8 Mon Sep 17 00:00:00 2001 From: wizjany Date: Thu, 9 May 2019 10:28:08 -0400 Subject: [PATCH] Re-use command manager service. --- .../extension/platform/PlatformCommandManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java index b56877590..d1a53d763 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java @@ -151,6 +151,7 @@ public final class PlatformCommandManager { private final WorldEdit worldEdit; private final PlatformManager platformManager; + private final CommandManagerServiceImpl commandManagerService; private final CommandManager commandManager; private final InjectedValueStore globalInjectedValues; private final DynamicStreamHandler dynamicHandler = new DynamicStreamHandler(); @@ -168,7 +169,8 @@ public final class PlatformCommandManager { this.worldEdit = worldEdit; this.platformManager = platformManager; this.exceptionConverter = new WorldEditExceptionConverter(worldEdit); - this.commandManager = new CommandManagerServiceImpl().newCommandManager(); + this.commandManagerService = new CommandManagerServiceImpl(); + this.commandManager = commandManagerService.newCommandManager(); this.globalInjectedValues = MapBackedValueStore.create(); this.registration = new CommandRegistrationHandler( ImmutableList.of( @@ -253,8 +255,7 @@ public final class PlatformCommandManager { cmd.description(TextComponent.of(desc)); cmd.action(Command.Action.NULL_ACTION); - CommandManager manager = DefaultCommandManagerService.getInstance() - .newCommandManager(); + CommandManager manager = commandManagerService.newCommandManager(); this.registration.register( manager, registration,