Call createProxyActor() on command Actors.

This commit is contained in:
sk89q 2014-06-27 20:12:44 -07:00
parent b8b097ce68
commit de0f283656
2 changed files with 6 additions and 3 deletions

View File

@ -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 static final java.util.regex.Pattern numberFormatExceptionPattern = java.util.regex.Pattern.compile("^For input string: \"(.*)\"$");
private final WorldEdit worldEdit; private final WorldEdit worldEdit;
private final PlatformManager platformManager;
private final Dispatcher dispatcher; private final Dispatcher dispatcher;
private final DynamicStreamHandler dynamicHandler = new DynamicStreamHandler(); private final DynamicStreamHandler dynamicHandler = new DynamicStreamHandler();
@ -70,9 +71,11 @@ public final class CommandManager {
* *
* @param worldEdit the WorldEdit instance * @param worldEdit the WorldEdit instance
*/ */
CommandManager(final WorldEdit worldEdit) { CommandManager(final WorldEdit worldEdit, PlatformManager platformManager) {
checkNotNull(worldEdit); checkNotNull(worldEdit);
checkNotNull(platformManager);
this.worldEdit = worldEdit; this.worldEdit = worldEdit;
this.platformManager = platformManager;
// Register this instance for command events // Register this instance for command events
worldEdit.getEventBus().register(this); worldEdit.getEventBus().register(this);
@ -195,7 +198,7 @@ public final class CommandManager {
public void handleCommand(CommandEvent event) { public void handleCommand(CommandEvent event) {
Request.reset(); Request.reset();
Actor actor = event.getActor(); Actor actor = platformManager.createProxyActor(event.getActor());
String split[] = commandDetection(event.getArguments()); String split[] = commandDetection(event.getArguments());
// No command found! // No command found!

View File

@ -65,7 +65,7 @@ public class PlatformManager {
public PlatformManager(WorldEdit worldEdit) { public PlatformManager(WorldEdit worldEdit) {
checkNotNull(worldEdit); checkNotNull(worldEdit);
this.worldEdit = worldEdit; this.worldEdit = worldEdit;
this.commandManager = new CommandManager(worldEdit); this.commandManager = new CommandManager(worldEdit, this);
// Register this instance for events // Register this instance for events
worldEdit.getEventBus().register(this); worldEdit.getEventBus().register(this);