Changed command execution to allow chat command catchers to be activated

This commit is contained in:
Alastair 2017-12-02 01:48:59 +00:00
parent 726a4d7ba2
commit 5b12a9960f
2 changed files with 6 additions and 4 deletions

View File

@ -10,7 +10,6 @@ import org.bukkit.event.block.BlockFromToEvent;
public class FlowStopper implements Listener {
@SuppressWarnings("unused")
private final AdvancedPortalsPlugin plugin;
// The needed config values will be stored so they are easier to access later

View File

@ -462,7 +462,8 @@ public class Portal {
boolean wasOp = player.isOp();
try {
player.setOp(true);
player.performCommand(command);
player.chat("/" + command);
//player.performCommand(command);
} finally {
player.setOp(wasOp);
}
@ -471,12 +472,14 @@ public class Portal {
PermissionAttachment permissionAttachment = null;
try {
permissionAttachment = player.addAttachment(plugin, "*", true);
player.performCommand(command);
player.chat("/" + command);
//player.performCommand(command);
} finally {
player.removeAttachment(permissionAttachment);
}
} else {
player.performCommand(command);
player.chat("/" + command);
//player.performCommand(command);
}
command = portal.getArg("command." + ++commandLine);
} while (command != null);