Improve API of RegionDataStore, RegionBackups.Backup

This commit is contained in:
2026-09-07 11:42:21 +02:00
parent deefe44dcd
commit f8f396afee
8 changed files with 38 additions and 37 deletions
@@ -41,12 +41,12 @@ public abstract class RegionData {
protected RegionData(RegionDataStore store) {
this.store = store;
initialize();
store.loadRegionData(this);
store.loadRegion();
}
public final void setStore(RegionDataStore store) {
this.store = store;
store.saveRegionData(this);
store.saveRegion();
}
protected void initialize() {
@@ -61,7 +61,7 @@ public abstract class RegionData {
public final <T extends Enum<T> & Flag.Value<T>> boolean set(@NonNull Flag<T> flag, @NonNull T value) {
if (has(flag).isWritable()) {
if (flagMap.put(flag, value) != value) {
store.saveRegionData(this);
store.saveRegion();
return true;
}
}
@@ -80,7 +80,7 @@ public abstract class RegionData {
}
}
properties.forEach(property -> property.set(null));
store.saveRegionData(this);
store.saveRegion();
}
public final Map<Flag<?>, Flag.Value<?>> getBackedMap() {
@@ -97,7 +97,7 @@ public abstract class RegionData {
public final void setTestblockSchematic(SchematicNode schematic) {
testblockSchematic.set(schematic);
store.saveRegionData(this);
store.saveRegion();
}
@Override