SteamWar/BauSystem
Archiviert
13
0

Simplify Region

Dieser Commit ist enthalten in:
jojo 2021-02-06 15:36:23 +01:00
Ursprung 7cfc8a9594
Commit 2950ddda36

Datei anzeigen

@ -229,26 +229,6 @@ public class Region {
} }
public enum ExtensionDirection {
PositiveZ("positivez", "z+"),
NegativeZ("negativez", "z-"),
PositiveX("positivex", "x+"),
NegativeX("negativex", "x-");
private Set<String> 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{ public static class Prototype{
private static final Map<String, Prototype> prototypes = new HashMap<>(); private static final Map<String, Prototype> prototypes = new HashMap<>();
@ -260,11 +240,10 @@ public class Region {
private final int offsetY; private final int offsetY;
private final int offsetZ; private final int offsetZ;
private final ExtensionDirection extensionFrontDirection; private final int extensionPositiveZ;
private final int extensionFront; private final int extensionNegativeZ;
private final int extensionBack; private final int extensionPositiveY;
private final int extensionUp; private final int extensionAxisX;
private final int extensionSides;
private final String schematic; private final String schematic;
private final boolean rotate; private final boolean rotate;
@ -282,11 +261,10 @@ public class Region {
offsetX = config.getInt("offsetX", 0); offsetX = config.getInt("offsetX", 0);
offsetY = config.getInt("offsetY", 0); offsetY = config.getInt("offsetY", 0);
offsetZ = config.getInt("offsetZ", 0); offsetZ = config.getInt("offsetZ", 0);
extensionFrontDirection = ExtensionDirection.getByString(config.getString("extensionFrontDirection", "").toLowerCase()); extensionPositiveZ = config.getInt("extensionPositiveZ", 0);
extensionFront = config.getInt("extensionFront", 0); extensionNegativeZ = config.getInt("extensionNegativeZ", 0);
extensionBack = config.getInt("extensionBack", 0); extensionPositiveY = config.getInt("extensionPositiveY", 0);
extensionUp = config.getInt("extensionUp", 0); extensionAxisX = config.getInt("extensionAxisX", 0);
extensionSides = config.getInt("extensionSides", 0);
rotate = config.getBoolean("rotate", false); rotate = config.getBoolean("rotate", false);
ConfigurationSection testblockSection = config.getConfigurationSection("testblock"); ConfigurationSection testblockSection = config.getConfigurationSection("testblock");