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..8c16f44b 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 @@ -28,6 +28,7 @@ import de.steamwar.bausystem.utils.ScoreboardElement; import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; @@ -67,6 +68,7 @@ public class TNTListener implements Listener, ScoreboardElement { @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onExplode(EntityExplodeEvent event) { + if (event.getEntityType() == EntityType.WIND_CHARGE) return; explode(event.blockList(), event.getEntity() instanceof TNTPrimed); } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeCommand.java index 51b0493a..3207528d 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeCommand.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeCommand.java @@ -20,6 +20,7 @@ package de.steamwar.bausystem.features.region; import de.steamwar.bausystem.region.Region; +import de.steamwar.bausystem.region.RegionUtils; import de.steamwar.bausystem.region.flags.Flag; import de.steamwar.bausystem.region.flags.WindChargeInteractMode; import de.steamwar.command.SWCommand; @@ -29,7 +30,7 @@ import org.bukkit.entity.Player; @Linked public class WindChargeInteractModeCommand extends SWCommand { public WindChargeInteractModeCommand() { - super("windcharge"); + super("windchargeinteract"); } @Register(description = "REGION_WINDCHARGE_HELP") @@ -37,8 +38,10 @@ public class WindChargeInteractModeCommand extends SWCommand { Region region = Region.getRegion(p.getLocation()); if (region.getRegionData().get(Flag.WIND_CHARGE_INTERACT).get() == WindChargeInteractMode.DENY) { region.getRegionData().set(Flag.WIND_CHARGE_INTERACT, WindChargeInteractMode.ALLOW); + RegionUtils.actionBar(region, "REGION_WINDCHARGE_INTERACT_ON"); } else { region.getRegionData().set(Flag.WIND_CHARGE_INTERACT, WindChargeInteractMode.DENY); + RegionUtils.actionBar(region, "REGION_WINDCHARGE_INTERACT_OFF"); } } } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeListener.java index 0728480d..a2037f82 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/region/WindChargeInteractModeListener.java @@ -38,7 +38,7 @@ public class WindChargeInteractModeListener implements Listener, ScoreboardEleme public void onExplode(EntityExplodeEvent event) { if (event.getEntityType() != EntityType.WIND_CHARGE) return; Region region = Region.getRegion(event.getLocation()); - if (region.getRegionData().get(Flag.WIND_CHARGE_INTERACT).getWithDefault() != WindChargeInteractMode.DENY) event.blockList().clear(); + if (region.getRegionData().get(Flag.WIND_CHARGE_INTERACT).getWithDefault() != WindChargeInteractMode.ALLOW) event.blockList().clear(); } @Override @@ -51,7 +51,7 @@ public class WindChargeInteractModeListener implements Listener, ScoreboardEleme } @Override public String get(Region region, Player p) { - //if (region.getRegionData().get(Flag.WIND_CHARGE).is(WindChargeMode.ALLOW)) return null; + if (region.getRegionData().get(Flag.WIND_CHARGE_INTERACT).is(WindChargeInteractMode.ALLOW)) return null; return "§e" + BauSystem.MESSAGE.parse(Flag.WIND_CHARGE_INTERACT.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.getRegionData().get(Flag.WIND_CHARGE_INTERACT).getWithDefault().getChatValue(), p); } } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/WindChargeInteractMode.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/WindChargeInteractMode.java index bb36391a..fc8e0aab 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/WindChargeInteractMode.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/region/flags/WindChargeInteractMode.java @@ -26,8 +26,8 @@ import lombok.Getter; @AllArgsConstructor public enum WindChargeInteractMode implements Flag.Value { - ALLOW("FLAG_WINDCHARGE_ALLOW"), - DENY("FLAG_WINDCHARGE_DENY"); + ALLOW("FLAG_WINDCHARGE_INTERACT_ALLOW"), + DENY("FLAG_WINDCHARGE_INTERACT_DENY"); private static WindChargeInteractMode[] values; private final String chatValue;