Update Permission #220
@ -128,9 +128,6 @@ public class SteamWarLuaPlugin extends TwoArgFunction {
|
||||
Bukkit.getLogger().log(Level.INFO, player.getName() + " dispatched command: " + command);
|
||||
String[] commandSplit = command.split(" ");
|
||||
if (!commandSplit[0].equals("select") && hasFAWE && WorldEditListener.isWorldEditCommand("/" + commandSplit[0])) {
|
||||
if (!Permission.BUILD.hasPermission(player)) {
|
||||
return NIL;
|
||||
}
|
||||
EditSession editSession = WorldEditUtils.getEditSession(player);
|
||||
Actor actor = BukkitAdapter.adapt(player);
|
||||
WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().handleCommandOnCurrentThread(new CommandEvent(actor, command, editSession));
|
||||
|
@ -117,23 +117,21 @@ public class BindCommand extends SWCommand implements Listener {
|
||||
|
||||
event.setCancelled(true);
|
||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||
PlayerCommandPreprocessEvent playerCommandPreprocessEvent = new PlayerCommandPreprocessEvent(event.getPlayer(), "/" + command);
|
||||
Bukkit.getPluginManager().callEvent(playerCommandPreprocessEvent);
|
||||
if (playerCommandPreprocessEvent.isCancelled()) return;
|
||||
PlayerCommandPreprocessEvent preprocessEvent = new PlayerCommandPreprocessEvent(event.getPlayer(), "/" + command);
|
||||
Bukkit.getPluginManager().callEvent(preprocessEvent);
|
||||
if (preprocessEvent.isCancelled()) return;
|
||||
|
||||
Bukkit.getLogger().log(Level.INFO, event.getPlayer().getName() + " dispatched command: " + command);
|
||||
String[] commandSplit = command.split(" ");
|
||||
String processedCommand = preprocessEvent.getMessage().substring(1);
|
||||
Bukkit.getLogger().log(Level.INFO, event.getPlayer().getName() + " dispatched command: " + processedCommand);
|
||||
String[] commandSplit = processedCommand.split(" ");
|
||||
if (!commandSplit[0].equals("select") && hasFAWE && WorldEditListener.isWorldEditCommand("/" + commandSplit[0])) {
|
||||
if (!Permission.WORLDEDIT.hasPermission(event.getPlayer())) {
|
||||
return;
|
||||
}
|
||||
EditSession editSession = WorldEditUtils.getEditSession(event.getPlayer());
|
||||
Actor actor = BukkitAdapter.adapt(event.getPlayer());
|
||||
WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().handleCommandOnCurrentThread(new CommandEvent(actor, command, editSession));
|
||||
WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().handleCommandOnCurrentThread(new CommandEvent(actor, processedCommand, editSession));
|
||||
editSession.flushSession();
|
||||
WorldEditUtils.addToPlayer(event.getPlayer(), editSession);
|
||||
} else {
|
||||
Bukkit.getServer().dispatchCommand(event.getPlayer(), command);
|
||||
Bukkit.getServer().dispatchCommand(event.getPlayer(), processedCommand);
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren