SteamWar/BauSystem2.0
Archiviert
12
0

Fix Region
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-12-01 20:18:18 +01:00
Ursprung b470cf56bb
Commit 46ae6afe3b

Datei anzeigen

@ -129,12 +129,20 @@ public class Region {
} }
}); });
} }
if (regionConfig.containsKey("prototype")) {
prototypes.add(regionConfig.getPlainValue("prototype"));
}
this.flagStorage = flagStorage; this.flagStorage = flagStorage;
Point point = null; Point point = null;
if (regionConfig.containsKey("minX", Integer.class) && regionConfig.containsKey("minY", Integer.class) && regionConfig.containsKey("minZ", Integer.class)) { if (regionConfig.containsKey("minX", Integer.class) && regionConfig.containsKey("minY", Integer.class) && regionConfig.containsKey("minZ", Integer.class)) {
point = new Point(regionConfig.getPlainValue("minX"), regionConfig.getPlainValue("minY"), regionConfig.getPlainValue("minZ")); point = new Point(regionConfig.getPlainValue("minX"), regionConfig.getPlainValue("minY"), regionConfig.getPlainValue("minZ"));
} }
generatePrototypeData(prototype, point); if (prototype != null && prototypes.contains(prototype.getName())) {
generatePrototypeData(prototype, point);
} else if (regionConfig.containsKey("prototype")) {
generatePrototypeData(Prototype.getByName(regionConfig.getPlainValue("prototype")), point);
}
if (!hasType(RegionType.BUILD) || !hasType(RegionType.TESTBLOCK)) { if (!hasType(RegionType.BUILD) || !hasType(RegionType.TESTBLOCK)) {
flagStorage.set(Flag.TNT, TNTMode.DENY); flagStorage.set(Flag.TNT, TNTMode.DENY);
@ -283,7 +291,7 @@ public class Region {
} }
public boolean setPrototype(@NonNull Prototype prototype) { public boolean setPrototype(@NonNull Prototype prototype) {
if (!prototypes.contains(prototype.getName()) && !prototypes.isEmpty()) { if (!prototypes.contains(prototype.getName())) {
return false; return false;
} }
return _setPrototype(prototype); return _setPrototype(prototype);
@ -292,10 +300,6 @@ public class Region {
boolean _setPrototype(@NonNull Prototype prototype) { boolean _setPrototype(@NonNull Prototype prototype) {
generatePrototypeData(prototype, minPoint); generatePrototypeData(prototype, minPoint);
RegionUtils.save(this); RegionUtils.save(this);
setLinkedRegion(region -> {
region.generatePrototypeData(prototype, region.minPoint);
return true;
});
return true; return true;
} }