Add Region.Area.place which is called ba Region.Area.reset

This commit is contained in:
2026-08-13 17:40:57 +02:00
parent 51810d2f7d
commit 5c71a71fc5
7 changed files with 49 additions and 12 deletions
@@ -48,11 +48,16 @@ public class DynamicRegionCommand extends SWCommand {
Tile tile = Tile.fromLocation(player.getLocation()).orElse(null);
if (tile == null) return;
// Check location!
Class<? extends DynamicRegion> regionClass = DynamicRegionSystem.identifierDataMap.get(regionType);
DynamicRegion dynamicRegion = DynamicRegionRepository.constructRegion(regionClass, UUID.randomUUID(), tile.getMinX(), tile.getMinZ());
if (dynamicRegion == null) {
// TODO: Give error to user
return;
}
dynamicRegion.getArea().reset(new PasteBuilder(new PasteBuilder.FileProvider(dynamicRegion.getArea().getResetFile())), false);
// TODO: This here still has some kind of error!aww
dynamicRegion.getArea().place(new PasteBuilder(new PasteBuilder.FileProvider(dynamicRegion.getArea().getResetFile())), false);
dynamicRegion.updateNeighbours();
}