SteamWar/BauSystem
Archiviert
13
0

Add save/load GlobalRegion options

Dieser Commit ist enthalten in:
yoyosource 2021-04-05 14:31:47 +02:00
Ursprung 485efedcfc
Commit 5bf771c1ce

Datei anzeigen

@ -141,6 +141,24 @@ public class Region {
private Region(ConfigurationSection config) {
name = config.getName();
minPoint = new Point(config.getInt("minX"), config.getInt("minY"), config.getInt("minZ"));
prototype = Prototype.prototypes.get(config.getString("prototype"));
optionsLinkedWith = config.getString("optionsLinkedWith", null);
if (!hasTestblock()) tntMode = TNTMode.OFF;
regions.add(this);
load();
}
public Region(String name) {
this.name = name;
this.minPoint = new Point(0, 0, 0);
this.prototype = null;
this.optionsLinkedWith = null;
tntMode = TNTMode.OFF;
load();
}
private void load() {
if (regionsObject.has(name)) {
regionOptions = regionsObject.getAsJsonObject(name);
if (regionOptions.has("tnt")) {
@ -171,20 +189,6 @@ public class Region {
} else {
regionsObject.add(name, regionOptions);
}
minPoint = new Point(config.getInt("minX"), config.getInt("minY"), config.getInt("minZ"));
prototype = Prototype.prototypes.get(config.getString("prototype"));
optionsLinkedWith = config.getString("optionsLinkedWith", null);
if (!hasTestblock()) tntMode = TNTMode.OFF;
regions.add(this);
}
public Region(String name) {
this.name = name;
this.minPoint = new Point(0, 0, 0);
this.prototype = null;
this.optionsLinkedWith = null;
tntMode = TNTMode.OFF;
}
public Color getColor() {