From 61c7a5c7a66c45e48825bf5ff4a1771fafeebb7f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 3 Apr 2021 22:16:09 +0200 Subject: [PATCH] Fix Region.hasExtensionArea --- .../bausystem/world/regions/GlobalRegion.java | 7 +------ .../steamwar/bausystem/world/regions/Region.java | 16 ++++++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/GlobalRegion.java b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/GlobalRegion.java index e16d048..363284c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/GlobalRegion.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/GlobalRegion.java @@ -58,12 +58,7 @@ public class GlobalRegion extends Region { } @Override - public boolean hasBuildAreaExtensionAreaRegistered() { - return false; - } - - @Override - public boolean hasTestblockExtensionAreaRegistered() { + public boolean hasExtensionArea(RegionType regionType) { return false; } } \ No newline at end of file diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Region.java index 22e904d..fbd113a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Region.java @@ -223,12 +223,16 @@ public class Region { undosessions.push(prototype.protect(this, schem)); } - public boolean hasBuildAreaExtensionAreaRegistered() { - return prototype.buildArea.extensionPrototypeArea; - } - - public boolean hasTestblockExtensionAreaRegistered() { - return prototype.testblock.extensionPrototypeArea; + public boolean hasExtensionArea(RegionType regionType) { + switch (regionType) { + case BUILD: + return prototype.buildArea.extensionPrototypeArea; + case TESTBLOCK: + return prototype.testblock.extensionPrototypeArea; + default: + case NORMAL: + return prototype.extensionPrototypeArea; + } } private void initSessions() {