SteamWar/BauSystem2.0
Archiviert
12
0

Update Permission #220

Zusammengeführt
YoyoNow hat 35 Commits von PermissionUpdate nach master 2024-02-17 08:53:31 +01:00 zusammengeführt
2 geänderte Dateien mit 8 neuen und 13 gelöschten Zeilen
Nur Änderungen aus Commit 21e7bd89af werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -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));

Datei anzeigen

@ -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);
}