From c6e8cad799c7b284add789c9258c7cefb0b44604 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 11 Dec 2020 15:31:54 +0100 Subject: [PATCH] Fix WE Security issue --- .../de/steamwar/bausystem/world/RegionListener.java | 13 ++++++++++--- BauSystem_Main/src/plugin.yml | 12 ------------ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java b/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java index f2239dc..32b54c1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java @@ -86,12 +86,19 @@ public class RegionListener implements Listener { } } + private static final String[] shortcutCommands = {"//1", "//2", "//90", "//-90", "//180", "//p", "//c", "//flopy", "//floppy", "//flopyp", "//floppyp", "//u", "//r"}; + private boolean isWorldEditCommand(String command) { + for(String shortcut : shortcutCommands) + if(command.startsWith(shortcut)) + return true; + switch(Core.getVersion()){ - case 15: - return RegionListener_15.isWorldEditCommand(command); - default: + case 12: return RegionListener_12.isWorldEditCommand(command); + case 15: + default: + return RegionListener_15.isWorldEditCommand(command); } } diff --git a/BauSystem_Main/src/plugin.yml b/BauSystem_Main/src/plugin.yml index c167863..0c6a0f4 100644 --- a/BauSystem_Main/src/plugin.yml +++ b/BauSystem_Main/src/plugin.yml @@ -33,15 +33,3 @@ commands: lockschem: detonator: aliases: dt - - /1: - /2: - /180: - /90: - /-90: - /p: - /c: - /flopy: - /flopyp: - /u: - /r: