From 2950ddda36b63a841eb36c5279b296a23b951dfd Mon Sep 17 00:00:00 2001 From: jojo Date: Sat, 6 Feb 2021 15:36:23 +0100 Subject: [PATCH] Simplify Region --- .../de/steamwar/bausystem/world/Region.java | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java index ee0907a..101eeba 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java @@ -229,26 +229,6 @@ public class Region { } - public enum ExtensionDirection { - PositiveZ("positivez", "z+"), - NegativeZ("negativez", "z-"), - PositiveX("positivex", "x+"), - NegativeX("negativex", "x-"); - - private Set values; - ExtensionDirection(String... values) { - this.values = new HashSet<>(Arrays.asList(values)); - } - - private static ExtensionDirection getByString(String value) { - for (ExtensionDirection extensionDirection : values()) { - if (extensionDirection.values.contains(value)) return extensionDirection; - } - return null; - } - - } - public static class Prototype{ private static final Map prototypes = new HashMap<>(); @@ -260,11 +240,10 @@ public class Region { private final int offsetY; private final int offsetZ; - private final ExtensionDirection extensionFrontDirection; - private final int extensionFront; - private final int extensionBack; - private final int extensionUp; - private final int extensionSides; + private final int extensionPositiveZ; + private final int extensionNegativeZ; + private final int extensionPositiveY; + private final int extensionAxisX; private final String schematic; private final boolean rotate; @@ -282,11 +261,10 @@ public class Region { offsetX = config.getInt("offsetX", 0); offsetY = config.getInt("offsetY", 0); offsetZ = config.getInt("offsetZ", 0); - extensionFrontDirection = ExtensionDirection.getByString(config.getString("extensionFrontDirection", "").toLowerCase()); - extensionFront = config.getInt("extensionFront", 0); - extensionBack = config.getInt("extensionBack", 0); - extensionUp = config.getInt("extensionUp", 0); - extensionSides = config.getInt("extensionSides", 0); + extensionPositiveZ = config.getInt("extensionPositiveZ", 0); + extensionNegativeZ = config.getInt("extensionNegativeZ", 0); + extensionPositiveY = config.getInt("extensionPositiveY", 0); + extensionAxisX = config.getInt("extensionAxisX", 0); rotate = config.getBoolean("rotate", false); ConfigurationSection testblockSection = config.getConfigurationSection("testblock");