Use RegionDataStore.deleteRegion instead of custom method in DynamicRegion

This commit is contained in:
2026-03-07 20:34:07 +01:00
parent 11362c73a7
commit a2aeaa5668
2 changed files with 3 additions and 2 deletions
@@ -65,7 +65,7 @@ public class DynamicRegionCommand extends SWCommand {
public void deleteRegion(Player player) {
Region region = DynamicRegionSystem.INSTANCE.get(player.getLocation());
if (!region.getType().isDeletable()) return;
((DynamicRegion) region).delete();
region.deleteRegion();
}
@Mapper("regionType")
@@ -94,7 +94,8 @@ public abstract class DynamicRegion implements Region {
regionData.setStore(this);
}
public void delete() {
@Override
public void deleteRegion() {
if (!getType().isDeletable()) return;
DynamicRegionSystem.INSTANCE.remove(this);
DynamicRegionRepository.deleteRegion(this);