diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/FireListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/FireListener.java index 7c29cd96..f54de73a 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/FireListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/FireListener.java @@ -60,6 +60,7 @@ public class FireListener implements Listener, ScoreboardElement { @Override public String get(Region region, Player p) { + if (region.getRegionData().has(Flag.FIRE).isNotApplicable()) return null; if (region.getRegionData().get(Flag.FIRE).isWithDefault(FireMode.DENY)) return null; return "§e" + BauSystem.MESSAGE.parse(Flag.FIRE.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.FIRE).getWithDefault().getChatValue(), p); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java index 976b48b4..6b9ef3ad 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java @@ -249,6 +249,7 @@ public class FreezeListener implements Listener, ScoreboardElement { @Override public String get(Region region, Player p) { + if (region.getRegionData().has(Flag.FREEZE).isNotApplicable()) return null; if (region.getRegionData().get(Flag.FREEZE).isWithDefault(FreezeMode.INACTIVE)) return null; return "§e" + BauSystem.MESSAGE.parse(Flag.FREEZE.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.FREEZE).getWithDefault().getChatValue(), p); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ItemsListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ItemsListener.java index 0ac8c03f..9f939192 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ItemsListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ItemsListener.java @@ -52,6 +52,7 @@ public class ItemsListener implements Listener, ScoreboardElement { @Override public String get(Region region, Player p) { + if (region.getRegionData().has(Flag.ITEMS).isNotApplicable()) return null; if (region.getRegionData().get(Flag.ITEMS).isWithDefault(ItemMode.INACTIVE)) return null; return "§e" + BauSystem.MESSAGE.parse(Flag.ITEMS.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.ITEMS).getWithDefault().getChatValue(), p); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/NoGravityListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/NoGravityListener.java index 528086e2..adcf4db6 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/NoGravityListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/NoGravityListener.java @@ -54,6 +54,7 @@ public class NoGravityListener implements Listener, ScoreboardElement { @Override public String get(Region region, Player p) { + if (region.getRegionData().has(Flag.NO_GRAVITY).isNotApplicable()) return null; if (region.getRegionData().get(Flag.NO_GRAVITY).isWithDefault(NoGravityMode.INACTIVE)) return null; return "§e" + BauSystem.MESSAGE.parse(Flag.NO_GRAVITY.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.NO_GRAVITY).getWithDefault().getChatValue(), p); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectListener.java index 3f933683..ef3731c5 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/ProtectListener.java @@ -70,6 +70,7 @@ public class ProtectListener implements Listener, ScoreboardElement { @Override public String get(Region region, Player p) { + if (region.getRegionData().has(Flag.PROTECT).isNotApplicable()) return null; if (region.getRegionData().get(Flag.PROTECT).isWithDefault(ProtectMode.INACTIVE)) return null; return "§e" + BauSystem.MESSAGE.parse(Flag.PROTECT.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.PROTECT).getWithDefault().getChatValue(), p); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java index 5e365c7d..39dd3dbd 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/TNTListener.java @@ -82,6 +82,7 @@ public class TNTListener implements Listener, ScoreboardElement { @Override public String get(Region region, Player p) { + if (region.getRegionData().has(Flag.TNT).isNotApplicable()) return null; if (region.getRegionData().get(Flag.TNT).isWithDefault(TNTMode.ALLOW)) return null; return "§e" + BauSystem.MESSAGE.parse(Flag.TNT.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.TNT).getWithDefault().getChatValue(), p); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WaterDestroyListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WaterDestroyListener.java index 0b0083f9..3ebde4dc 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WaterDestroyListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WaterDestroyListener.java @@ -53,6 +53,7 @@ public class WaterDestroyListener implements Listener, ScoreboardElement { @Override public String get(Region region, Player p) { + if (region.getRegionData().has(Flag.WATER_DESTROY).isNotApplicable()) return null; if (region.getRegionData().get(Flag.WATER_DESTROY).isWithDefault(WaterDestroyMode.ALLOW)) return null; return "§e" + BauSystem.MESSAGE.parse(Flag.WATER_DESTROY.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.WATER_DESTROY).getWithDefault().getChatValue(), p); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/RegionFlagPolicy.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/RegionFlagPolicy.java index 3c48505c..f355762e 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/RegionFlagPolicy.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/RegionFlagPolicy.java @@ -35,4 +35,8 @@ public enum RegionFlagPolicy { public boolean isApplicable() { return readable || writable; } + + public boolean isNotApplicable() { + return this == NOT_APPLICABLE; + } } diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/global/GlobalRegionData.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/global/GlobalRegionData.java index 86c9957f..d1abe3ac 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/global/GlobalRegionData.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/global/GlobalRegionData.java @@ -47,7 +47,7 @@ public class GlobalRegionData extends RegionData { if (flag.oneOf(Flag.ITEMS) && Core.getVersion() >= 20) { return RegionFlagPolicy.WRITABLE; } - if (flag.oneOf(Flag.TNT, Flag.FIRE, Flag.FREEZE)) { + if (flag.oneOf(Flag.TNT, Flag.FIRE, Flag.FREEZE, Flag.WATER_DESTROY)) { return RegionFlagPolicy.WRITABLE; } return RegionFlagPolicy.NOT_APPLICABLE; diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialRegionData.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialRegionData.java index b3c15ee0..777a3cd6 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialRegionData.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialRegionData.java @@ -52,7 +52,7 @@ public class SpecialRegionData extends RegionData { @Override public @NonNull & Flag.Value> RegionFlagPolicy has(@NonNull Flag flag) { - if (flag.oneOf(Flag.TNT, Flag.FIRE, Flag.FREEZE, Flag.PROTECT, Flag.NO_GRAVITY, Flag.CHANGED)) { + if (flag.oneOf(Flag.TNT, Flag.FIRE, Flag.FREEZE, Flag.PROTECT, Flag.NO_GRAVITY, Flag.WATER_DESTROY, Flag.CHANGED)) { return RegionFlagPolicy.WRITABLE; } if (flag.oneOf(Flag.ITEMS) && Core.getVersion() >= 20) {