Initial rudimentary implementation (not done) of PlotRegionBackups

This commit is contained in:
2026-09-07 11:42:22 +02:00
parent 59ccd50286
commit f1df25019b
4 changed files with 98 additions and 14 deletions
@@ -34,6 +34,7 @@ public abstract class RegionData {
private final List<Property<?, ?>> properties = new ArrayList<>();
protected final Map<Flag<?>, Flag.Value<?>> flagMap = new HashMap<>();
// TODO: These should be turned into an ECS like System because not every Region has them or should have them!
protected final Property<SchematicNode, Integer> testblockSchematic = new Property<>("testblockSchematic", SchematicNode::byId, SchematicNode::getId);
protected RegionData(RegionDataStore store) {
@@ -103,6 +104,18 @@ public abstract class RegionData {
});
}
/**
* This method only copies all flags and properties from this into other without saving other afterward.
*/
public final void copyInto(RegionData other) {
if (this == other) return;
other.flagMap.clear();
other.flagMap.putAll(flagMap);
// TODO: This might not be correct, needs to be investigated
other.properties.clear();
other.properties.addAll(properties);
}
public final Map<Flag<?>, Flag.Value<?>> getBackedMap() {
return flagMap;
}