SteamWar/BauSystem2.0
Archiviert
12
0

Fix BindCommand and SteamWarLuaPlugin
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2024-02-16 08:24:42 +01:00
Ursprung 953db69425
Commit 21e7bd89af
2 geänderte Dateien mit 8 neuen und 13 gelöschten Zeilen

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