From 4e4a1eb3e8908c7644990e4c375bfe8b1e157372 Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 24 Jan 2021 21:12:36 +0100 Subject: [PATCH 1/2] Add TNTMode to ONLY_TB --- .../src/de/steamwar/bausystem/commands/CommandTNT.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java index 23ab3b6..e4dd091 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java @@ -38,6 +38,12 @@ public class CommandTNT implements CommandExecutor, Listener { private static TNTMode tntMode = TNTMode.OFF; + static { + if (Region.buildAreaEnabled()) { + tntMode = TNTMode.ONLY_TB; + } + } + public static TNTMode getTntMode() { return tntMode; } From 093ab5802ed0c6a108fc8a7a44e4908b9d410202 Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 24 Jan 2021 21:15:19 +0100 Subject: [PATCH 2/2] Add TNTMode to ONLY_TB --- .../src/de/steamwar/bausystem/commands/CommandTNT.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java index e4dd091..91eb203 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java @@ -36,13 +36,7 @@ import org.bukkit.event.entity.EntityExplodeEvent; public class CommandTNT implements CommandExecutor, Listener { - private static TNTMode tntMode = TNTMode.OFF; - - static { - if (Region.buildAreaEnabled()) { - tntMode = TNTMode.ONLY_TB; - } - } + private static TNTMode tntMode = Region.buildAreaEnabled() ? TNTMode.ONLY_TB : TNTMode.OFF; public static TNTMode getTntMode() { return tntMode;