diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFire.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFire.java index 009b2d7..9c341d0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFire.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFire.java @@ -26,10 +26,6 @@ import org.bukkit.event.block.BlockSpreadEvent; public class CommandFire extends RegionToggleCommand { - public CommandFire() { - super(); - } - @Override String getNoPermMessage() { return "§cDu darfst hier nicht Feuerschaden (de-)aktivieren"; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java index 769ecd5..d456416 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java @@ -32,10 +32,6 @@ import org.bukkit.event.inventory.InventoryMoveItemEvent; public class CommandFreeze extends RegionToggleCommand { - public CommandFreeze(){ - super(); - } - @Override String getNoPermMessage() { return "§cDu darfst diese Welt nicht einfrieren"; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java index 9e44eb8..2199bc2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java @@ -36,7 +36,7 @@ public class CommandTNT implements CommandExecutor, Listener { public enum TNTMode { ON("§aan"), - ONLY_TB("§7nur §eTestblock"), + ONLY_TB("§7Kein §eBaurahmen"), OFF("§caus"); private String name; @@ -112,28 +112,28 @@ public class CommandTNT implements CommandExecutor, Listener { Region region = Region.getRegion(player.getLocation()); if (region == null) { - tntGlobalToggle(player, requestedMode, requestedMessage); + tntGlobalToggle(requestedMode, requestedMessage); return false; } tntToggle(region, requestedMode, requestedMessage); return false; } - private void tntGlobalToggle(Player player, TNTMode requestedMode, String requestedMessage) { + private void tntGlobalToggle(TNTMode requestedMode, String requestedMessage) { if (requestedMode != null && requestedMode != TNTMode.ONLY_TB) { Region.NoRegion.tnt = requestedMode; - RegionToggleCommand.actionBar(player, requestedMessage); + RegionToggleCommand.actionBar(requestedMessage); return; } switch (Region.NoRegion.tnt) { case ON: case ONLY_TB: Region.NoRegion.tnt = TNTMode.OFF; - RegionToggleCommand.actionBar(player, getDisableMessage()); + RegionToggleCommand.actionBar(getDisableMessage()); break; case OFF: Region.NoRegion.tnt = TNTMode.ON; - RegionToggleCommand.actionBar(player, getEnableMessage()); + RegionToggleCommand.actionBar(getEnableMessage()); break; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/RegionToggleCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/RegionToggleCommand.java index 49e36b8..6eba349 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/RegionToggleCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/RegionToggleCommand.java @@ -36,7 +36,7 @@ import org.bukkit.event.Listener; public abstract class RegionToggleCommand implements CommandExecutor, Listener { - RegionToggleCommand() { + public RegionToggleCommand() { Bukkit.getPluginManager().registerEvents(this, BauSystem.getPlugin()); } @@ -54,9 +54,9 @@ public abstract class RegionToggleCommand implements CommandExecutor, Listener { Region region = Region.getRegion(player.getLocation()); if (region == null) { if (toggleGlobal()) { - actionBar(player, getEnableMessage()); + actionBar(getEnableMessage()); } else { - actionBar(player, getDisableMessage()); + actionBar(getDisableMessage()); } return false; } @@ -72,8 +72,8 @@ public abstract class RegionToggleCommand implements CommandExecutor, Listener { Bukkit.getOnlinePlayers().stream().filter(player -> region.inRegion(player.getLocation())).forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(s))); } - public static void actionBar(Player player, String s) { - player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(s)); + public static void actionBar(String s) { + Bukkit.getOnlinePlayers().stream().filter(player -> Region.getRegion(player.getLocation()) == null).forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(s))); } abstract String getNoPermMessage();