diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java index eb984b0..dcd8d5b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java @@ -58,7 +58,9 @@ public class CommandRegion extends SWCommand { @Register("restore") public void genericRestoreCommand(Player p) { if (!permissionCheck(p)) return; - Region region = regionCheck(p); + Region region = Region.getRegion(p.getLocation()); + if(checkGlobalRegion(region, p)) return; + if (region == null) return; try { region.reset(null, true); @@ -72,7 +74,9 @@ public class CommandRegion extends SWCommand { @Register("restore") public void schematicRestoreCommand(Player p, String s) { if (!permissionCheck(p)) return; - Region region = regionCheck(p); + Region region = Region.getRegion(p.getLocation()); + if(checkGlobalRegion(region, p)) return; + if (region == null) return; Schematic schem = Schematic.getSchemFromDB(s, p.getUniqueId()); if (schem == null) { @@ -104,15 +108,6 @@ public class CommandRegion extends SWCommand { return true; } - private Region regionCheck(Player player) { - Region region = Region.getRegion(player.getLocation()); - if (region == Region.GlobalRegion.getInstance()) { - player.sendMessage(BauSystem.PREFIX + "§cDu befindest dich derzeit in keiner Region"); - return null; - } - return region; - } - enum Action { UNDO, REDO