forked from SteamWar/SteamWar
Improve API of RegionDataStore, RegionBackups.Backup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user