From 010bac9741013d2b10a37a12f6378055a4892982 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 9 Apr 2021 16:51:52 +0200 Subject: [PATCH] Add initial CommandProtect usability --- .../steamwar/bausystem/commands/CommandProtect.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java index 5917041..259fe14 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java @@ -48,6 +48,15 @@ public class CommandProtect extends SWCommand { if (!permissionCheck(p)) return; Region region = regionCheck(p); if (region == null) return; + if (Region.buildAreaEnabled()) { + region.setProtect(!region.isProtect()); + if (region.isProtect()) { + p.sendMessage(BauSystem.PREFIX + "§7Boden geschützt"); + } else { + p.sendMessage(BauSystem.PREFIX + "§7Boden Schutz aufgehoben"); + } + return; + } try { region.protect(null); p.sendMessage(BauSystem.PREFIX + "§7Boden geschützt"); @@ -60,6 +69,10 @@ public class CommandProtect extends SWCommand { @Register public void schematicProtectCommand(Player p, String s) { if (!permissionCheck(p)) return; + if (Region.buildAreaEnabled()) { + genericHelp(p); + return; + } Region region = regionCheck(p); if (region == null) return; Schematic schem = Schematic.getSchemFromDB(s, p.getUniqueId());