Add RegionData

Improve TestblockCommand with remembering the TB
This commit is contained in:
2025-10-17 21:36:50 +02:00
parent 4e050106f5
commit f9c320cb33
6 changed files with 136 additions and 2 deletions
@@ -139,4 +139,9 @@ public final class FixedGlobalRegion implements Region {
public @NonNull RegionBackups getBackups() {
return RegionBackups.EMPTY;
}
@Override
public @NonNull RegionData getRegionData() {
return RegionData.EMPTY;
}
}
@@ -26,6 +26,7 @@ import de.steamwar.bausystem.region.flags.Flag;
import de.steamwar.bausystem.region.flags.TestblockMode;
import de.steamwar.bausystem.utils.FlatteningWrapper;
import de.steamwar.bausystem.utils.PasteBuilder;
import de.steamwar.bausystem.worlddata.WorldData;
import de.steamwar.core.Core;
import de.steamwar.sql.SchematicType;
import lombok.NonNull;
@@ -57,6 +58,7 @@ public class FixedRegion implements Region {
private final int floorLevel;
private final int waterLevel;
private final GameModeConfig gameModeConfig;
private final RegionData regionData;
private final RegionHistory regionHistory = new RegionHistory.Impl(20);
private final RegionBackups regionBackups = new RegionBackups() {
@@ -335,6 +337,7 @@ public class FixedRegion implements Region {
}
}
this.gameModeConfig = new GameModeConfig(found);
this.regionData = new RegionData.RegionDataImpl(regionData, WorldData::write);
}
@Override
@@ -381,4 +384,9 @@ public class FixedRegion implements Region {
public @NonNull RegionBackups getBackups() {
return regionBackups;
}
@Override
public @NonNull RegionData getRegionData() {
return regionData;
}
}