forked from SteamWar/SteamWar
Use RegionDataStore.deleteRegion instead of custom method in DynamicRegion
This commit is contained in:
+1
-1
@@ -65,7 +65,7 @@ public class DynamicRegionCommand extends SWCommand {
|
|||||||
public void deleteRegion(Player player) {
|
public void deleteRegion(Player player) {
|
||||||
Region region = DynamicRegionSystem.INSTANCE.get(player.getLocation());
|
Region region = DynamicRegionSystem.INSTANCE.get(player.getLocation());
|
||||||
if (!region.getType().isDeletable()) return;
|
if (!region.getType().isDeletable()) return;
|
||||||
((DynamicRegion) region).delete();
|
region.deleteRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Mapper("regionType")
|
@Mapper("regionType")
|
||||||
|
|||||||
+2
-1
@@ -94,7 +94,8 @@ public abstract class DynamicRegion implements Region {
|
|||||||
regionData.setStore(this);
|
regionData.setStore(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete() {
|
@Override
|
||||||
|
public void deleteRegion() {
|
||||||
if (!getType().isDeletable()) return;
|
if (!getType().isDeletable()) return;
|
||||||
DynamicRegionSystem.INSTANCE.remove(this);
|
DynamicRegionSystem.INSTANCE.remove(this);
|
||||||
DynamicRegionRepository.deleteRegion(this);
|
DynamicRegionRepository.deleteRegion(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user