From eadc741137c60f2efd2c2ec5b4fa392b8c0b41f1 Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 17 Feb 2021 10:06:51 +0100 Subject: [PATCH 1/4] Add Region.extensionArea Add Region.extensionAreaEnabled --- .../src/de/steamwar/bausystem/world/Region.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java index e7a6007..a2a9c48 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java @@ -40,6 +40,7 @@ public class Region { private static final List regions = new ArrayList<>(); private static boolean buildArea = false; + private static boolean extensionArea = false; static{ YamlConfiguration config = new YamlConfiguration(); @@ -66,6 +67,10 @@ public class Region { return buildArea; } + public static boolean extensionAreaEnabled() { + return extensionArea; + } + public static Region getRegion(Location location) { for (Region region : regions) { if (region.inRegion(location)) return region; @@ -264,6 +269,9 @@ public class Region { extensionNegativeZ = config.getInt("extensionNegativeZ", 0); extensionPositiveY = config.getInt("extensionPositiveY", 0); extensionAxisX = config.getInt("extensionAxisX", 0); + if (config.contains("extensionPositiveZ") || config.contains("extensionNegativeZ") || config.contains("extensionPositiveY") || config.contains("extensionAxisX")) { + extensionArea = true; + } rotate = config.getBoolean("rotate", false); ConfigurationSection testblockSection = config.getConfigurationSection("testblock"); -- 2.39.5 From 0a60393cc33a65e4e4f79811ce8f1a222bde8f9f Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 17 Feb 2021 14:44:46 +0100 Subject: [PATCH 2/4] Add Region.Prototype.extensionPrototypeArea --- .../src/de/steamwar/bausystem/world/Region.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java index a2a9c48..2dfa4f8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java @@ -195,6 +195,14 @@ public class Region { prototype.protect(this, schem); } + public boolean hasExtensionAreaRegistered() { + return prototype.extensionPrototypeArea; + } + + public boolean hasTestblockExtensionAreaRegistered() { + return prototype.testblock.extensionPrototypeArea; + } + public static class GlobalRegion extends Region { private static final GlobalRegion GLOBAL_REGION = new GlobalRegion(); @@ -248,6 +256,7 @@ public class Region { private final int extensionNegativeZ; private final int extensionPositiveY; private final int extensionAxisX; + private final boolean extensionPrototypeArea; private final String schematic; private final boolean rotate; @@ -271,6 +280,9 @@ public class Region { extensionAxisX = config.getInt("extensionAxisX", 0); if (config.contains("extensionPositiveZ") || config.contains("extensionNegativeZ") || config.contains("extensionPositiveY") || config.contains("extensionAxisX")) { extensionArea = true; + extensionPrototypeArea = true; + } else { + extensionPrototypeArea = false; } rotate = config.getBoolean("rotate", false); -- 2.39.5 From 185387c7b2f6c3800c299717fd844284c60b0ac8 Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 17 Feb 2021 14:45:09 +0100 Subject: [PATCH 3/4] Add Region.Prototype.extensionPrototypeArea --- .../src/de/steamwar/bausystem/world/Region.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java index 2dfa4f8..484521b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java @@ -239,6 +239,15 @@ public class Region { return false; } + @Override + public boolean hasExtensionAreaRegistered() { + return false; + } + + @Override + public boolean hasTestblockExtensionAreaRegistered() { + return false; + } } public static class Prototype{ -- 2.39.5 From 79fb836edcd986aa958070d43a44d44932198180 Mon Sep 17 00:00:00 2001 From: jojo Date: Mon, 22 Feb 2021 12:47:16 +0100 Subject: [PATCH 4/4] Add Region.Prototype.extensionPrototypeArea --- BauSystem_Main/src/de/steamwar/bausystem/world/Region.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java index 484521b..01183bf 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java @@ -289,10 +289,8 @@ public class Region { extensionAxisX = config.getInt("extensionAxisX", 0); if (config.contains("extensionPositiveZ") || config.contains("extensionNegativeZ") || config.contains("extensionPositiveY") || config.contains("extensionAxisX")) { extensionArea = true; - extensionPrototypeArea = true; - } else { - extensionPrototypeArea = false; } + extensionPrototypeArea = extensionNegativeZ != 0 || extensionPositiveZ != 0 || extensionPositiveY != 0 || extensionAxisX != 0; rotate = config.getBoolean("rotate", false); ConfigurationSection testblockSection = config.getConfigurationSection("testblock"); -- 2.39.5