Fix schematic commands for SteamWarLuaPlugin

Closes: #228
This commit is contained in:
2025-11-25 22:10:14 +01:00
parent 1ae445319a
commit 5bdbf5dff4
@@ -48,6 +48,7 @@ import java.util.logging.Level;
public class SteamWarLuaPlugin extends TwoArgFunction {
private static final boolean hasFAWE = Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null;
private static final Set<String> ignoreCommandFromWorldEdit = Set.of("select", "schem", "/schem", "schematic", "/schematic");
protected static final Map<Class<?>, List<LuaLib>> LUA_LIBS = new HashMap<>();
@@ -116,7 +117,7 @@ public class SteamWarLuaPlugin extends TwoArgFunction {
command = preprocessEvent.getMessage().substring(1);
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 (!ignoreCommandFromWorldEdit.contains(commandSplit[0]) && hasFAWE && WorldEditListener.isWorldEditCommand("/" + commandSplit[0])) {
EditSession editSession = WorldEditUtils.getEditSession(player);
Actor actor = BukkitAdapter.adapt(player);
WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().handleCommandOnCurrentThread(new CommandEvent(actor, command, editSession));