Merge pull request 'Add Region.extensionArea' (#196) from ExtensionAreaBoolean into master
Reviewed-on: #196 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
f3937990ca
@ -40,6 +40,7 @@ public class Region {
|
|||||||
|
|
||||||
private static final List<Region> regions = new ArrayList<>();
|
private static final List<Region> regions = new ArrayList<>();
|
||||||
private static boolean buildArea = false;
|
private static boolean buildArea = false;
|
||||||
|
private static boolean extensionArea = false;
|
||||||
|
|
||||||
static{
|
static{
|
||||||
YamlConfiguration config = new YamlConfiguration();
|
YamlConfiguration config = new YamlConfiguration();
|
||||||
@ -66,6 +67,10 @@ public class Region {
|
|||||||
return buildArea;
|
return buildArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean extensionAreaEnabled() {
|
||||||
|
return extensionArea;
|
||||||
|
}
|
||||||
|
|
||||||
public static Region getRegion(Location location) {
|
public static Region getRegion(Location location) {
|
||||||
for (Region region : regions) {
|
for (Region region : regions) {
|
||||||
if (region.inRegion(location)) return region;
|
if (region.inRegion(location)) return region;
|
||||||
@ -190,6 +195,14 @@ public class Region {
|
|||||||
prototype.protect(this, schem);
|
prototype.protect(this, schem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasExtensionAreaRegistered() {
|
||||||
|
return prototype.extensionPrototypeArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasTestblockExtensionAreaRegistered() {
|
||||||
|
return prototype.testblock.extensionPrototypeArea;
|
||||||
|
}
|
||||||
|
|
||||||
public static class GlobalRegion extends Region {
|
public static class GlobalRegion extends Region {
|
||||||
|
|
||||||
private static final GlobalRegion GLOBAL_REGION = new GlobalRegion();
|
private static final GlobalRegion GLOBAL_REGION = new GlobalRegion();
|
||||||
@ -226,6 +239,15 @@ public class Region {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasExtensionAreaRegistered() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasTestblockExtensionAreaRegistered() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Prototype{
|
public static class Prototype{
|
||||||
@ -243,6 +265,7 @@ public class Region {
|
|||||||
private final int extensionNegativeZ;
|
private final int extensionNegativeZ;
|
||||||
private final int extensionPositiveY;
|
private final int extensionPositiveY;
|
||||||
private final int extensionAxisX;
|
private final int extensionAxisX;
|
||||||
|
private final boolean extensionPrototypeArea;
|
||||||
|
|
||||||
private final String schematic;
|
private final String schematic;
|
||||||
private final boolean rotate;
|
private final boolean rotate;
|
||||||
@ -264,6 +287,10 @@ public class Region {
|
|||||||
extensionNegativeZ = config.getInt("extensionNegativeZ", 0);
|
extensionNegativeZ = config.getInt("extensionNegativeZ", 0);
|
||||||
extensionPositiveY = config.getInt("extensionPositiveY", 0);
|
extensionPositiveY = config.getInt("extensionPositiveY", 0);
|
||||||
extensionAxisX = config.getInt("extensionAxisX", 0);
|
extensionAxisX = config.getInt("extensionAxisX", 0);
|
||||||
|
if (config.contains("extensionPositiveZ") || config.contains("extensionNegativeZ") || config.contains("extensionPositiveY") || config.contains("extensionAxisX")) {
|
||||||
|
extensionArea = true;
|
||||||
|
}
|
||||||
|
extensionPrototypeArea = extensionNegativeZ != 0 || extensionPositiveZ != 0 || extensionPositiveY != 0 || extensionAxisX != 0;
|
||||||
rotate = config.getBoolean("rotate", false);
|
rotate = config.getBoolean("rotate", false);
|
||||||
|
|
||||||
ConfigurationSection testblockSection = config.getConfigurationSection("testblock");
|
ConfigurationSection testblockSection = config.getConfigurationSection("testblock");
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren