forked from SteamWar/SteamWar
Add Region.Area.place which is called ba Region.Area.reset
This commit is contained in:
+7
-2
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user