From de0f283656b329e114754d86c1c935dc7a40a1d2 Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 27 Jun 2014 20:12:44 -0700 Subject: [PATCH] Call createProxyActor() on command Actors. --- .../sk89q/worldedit/extension/platform/CommandManager.java | 7 +++++-- .../worldedit/extension/platform/PlatformManager.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java b/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java index a92472f0d..0d068e687 100644 --- a/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java +++ b/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java @@ -62,6 +62,7 @@ public final class CommandManager { private static final java.util.regex.Pattern numberFormatExceptionPattern = java.util.regex.Pattern.compile("^For input string: \"(.*)\"$"); private final WorldEdit worldEdit; + private final PlatformManager platformManager; private final Dispatcher dispatcher; private final DynamicStreamHandler dynamicHandler = new DynamicStreamHandler(); @@ -70,9 +71,11 @@ public final class CommandManager { * * @param worldEdit the WorldEdit instance */ - CommandManager(final WorldEdit worldEdit) { + CommandManager(final WorldEdit worldEdit, PlatformManager platformManager) { checkNotNull(worldEdit); + checkNotNull(platformManager); this.worldEdit = worldEdit; + this.platformManager = platformManager; // Register this instance for command events worldEdit.getEventBus().register(this); @@ -195,7 +198,7 @@ public final class CommandManager { public void handleCommand(CommandEvent event) { Request.reset(); - Actor actor = event.getActor(); + Actor actor = platformManager.createProxyActor(event.getActor()); String split[] = commandDetection(event.getArguments()); // No command found! diff --git a/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index ea5db45f6..3e70e2483 100644 --- a/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -65,7 +65,7 @@ public class PlatformManager { public PlatformManager(WorldEdit worldEdit) { checkNotNull(worldEdit); this.worldEdit = worldEdit; - this.commandManager = new CommandManager(worldEdit); + this.commandManager = new CommandManager(worldEdit, this); // Register this instance for events worldEdit.getEventBus().register(this);