diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java index 6f7a92c7..7893b8c4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/MaterialCommand.java @@ -21,6 +21,7 @@ package de.steamwar.bausystem.features.util; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.SWUtils; +import de.steamwar.bausystem.features.world.WorldEditListener; import de.steamwar.bausystem.shared.EnumDisplay; import de.steamwar.command.PreviousArguments; import de.steamwar.command.SWCommand; @@ -51,6 +52,7 @@ public class MaterialCommand extends SWCommand implements Listener { public MaterialCommand() { super("material", "baumaterial"); + WorldEditListener.addCommandExclusion("material"); } private Map searchMap = new HashMap<>(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/WorldEditListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/WorldEditListener.java index 19dc6e09..ba9d6d9e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/WorldEditListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/WorldEditListener.java @@ -51,7 +51,12 @@ public class WorldEditListener implements Listener { commands.add(s); } + public static void addCommandExclusion(String s) { + commandExclusions.add(s); + } + private static final Set commands = new HashSet<>(); + private static final Set commandExclusions = new HashSet<>(); private static final String[] shortcutCommands = {"//1", "//2", "//90", "//-90", "//180", "//p", "//c", "//flopy", "//floppy", "//flopyp", "//floppyp", "//u", "//r"}; public static boolean isWorldEditCommand(String command) { @@ -61,6 +66,9 @@ public class WorldEditListener implements Listener { for (String s : commands) { if (command.startsWith(s)) return true; } + for (String s : commandExclusions) { + if (command.startsWith(s)) return false; + } return FlatteningWrapper.impl.isWorldEditCommand(command); }