forked from SteamWar/SteamWar
+2
-1
@@ -48,6 +48,7 @@ import java.util.logging.Level;
|
|||||||
public class SteamWarLuaPlugin extends TwoArgFunction {
|
public class SteamWarLuaPlugin extends TwoArgFunction {
|
||||||
|
|
||||||
private static final boolean hasFAWE = Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null;
|
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<>();
|
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);
|
command = preprocessEvent.getMessage().substring(1);
|
||||||
Bukkit.getLogger().log(Level.INFO, player.getName() + " dispatched command: " + command);
|
Bukkit.getLogger().log(Level.INFO, player.getName() + " dispatched command: " + command);
|
||||||
String[] commandSplit = command.split(" ");
|
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);
|
EditSession editSession = WorldEditUtils.getEditSession(player);
|
||||||
Actor actor = BukkitAdapter.adapt(player);
|
Actor actor = BukkitAdapter.adapt(player);
|
||||||
WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().handleCommandOnCurrentThread(new CommandEvent(actor, command, editSession));
|
WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().handleCommandOnCurrentThread(new CommandEvent(actor, command, editSession));
|
||||||
|
|||||||
Reference in New Issue
Block a user