diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java index 39eb0ce..ee0907a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java @@ -230,21 +230,17 @@ 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)); } - public static ExtensionDirection getByString(String value) { - if (value == null) return null; - value = value.toLowerCase(); + private static ExtensionDirection getByString(String value) { for (ExtensionDirection extensionDirection : values()) { if (extensionDirection.values.contains(value)) return extensionDirection; } @@ -286,7 +282,7 @@ public class Region { offsetX = config.getInt("offsetX", 0); offsetY = config.getInt("offsetY", 0); offsetZ = config.getInt("offsetZ", 0); - extensionFrontDirection = ExtensionDirection.getByString(config.getString("extensionFrontDirection", null)); + extensionFrontDirection = ExtensionDirection.getByString(config.getString("extensionFrontDirection", "").toLowerCase()); extensionFront = config.getInt("extensionFront", 0); extensionBack = config.getInt("extensionBack", 0); extensionUp = config.getInt("extensionUp", 0);