diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index d6aabbc8..dcaf8b5c 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1117,7 +1117,7 @@ PANZERN_PROGRESS = §e{0} §7Blöcke übrig, §e{1} §7Blöcke pro Sekunde, §e{ PANZERN_DONE = §aZuende gepanzert # Laufbau -LAUFBAU_HELP = §8/§elaufbau §8[§7Block§8] §8[§7Slab§8] §8- §7Baue einen Lauf in deiner WorldEdit Auswahl mit den Traces +LAUFBAU_HELP = §8/§elaufbau §8[§7smallest§8|§7blastresistant§8] §8- §7Baue einen Lauf in deiner WorldEdit Auswahl mit den Traces LAUFBAU_PREPARE1 = §71. Trace die Kanonen so oft wie nötig, in allen Modi. LAUFBAU_PREPARE2 = §72. Versuche alle Fails aus dem Trace zu löschen. LAUFBAU_NO_PERM = §cDu darfst hier nicht das Laufbau System verwenden @@ -1125,11 +1125,11 @@ LAUFBAU_NO_WORLDEDIT = §cDu hast keine WorldEdit Selection LAUFBAU_STATE_FILTERING_TRACES = Traces filtern LAUFBAU_STATE_PROCESSING_TRACES = Traces verbinden LAUFBAU_STATE_EXPANDING_TRACES = Traces aufblähen -LAUFBAU_STATE_SPLITTING_POINTS = Punkte aufteilen +LAUFBAU_STATE_SPLITTING_POINTS = Punkte trennen LAUFBAU_STATE_SHRINKING_POINTS = Punkte ausdünnen LAUFBAU_STATE_CREATING_INNER_BLOCKS = Innenraum füllen LAUFBAU_STATE_CREATING_OUTER_BLOCKS = Mantel bauen -LAUFBAU_SIMPLE_PROGRESS = §e{0}§8: §e{1}§8/§7{2} +LAUFBAU_SIMPLE_PROGRESS = §e{0}§8: §e{1}§8/§e{2} LAUFBAU_DONE = §aZuende gebaut # UTILS diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java index 933beb42..b176a370 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauCommand.java @@ -27,18 +27,11 @@ import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.shared.Pair; import de.steamwar.command.SWCommand; -import de.steamwar.command.TypeMapper; +import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - @Linked(LinkageType.COMMAND) public class LaufbauCommand extends SWCommand { @@ -54,16 +47,8 @@ public class LaufbauCommand extends SWCommand { return false; } - @Register(help = true) - public void genericHelp(Player player, String... args) { - BauSystem.MESSAGE.send("COMMAND_HELP_HEAD", player, "laufbau"); - BauSystem.MESSAGE.send("LAUFBAU_HELP", player); - BauSystem.MESSAGE.send("LAUFBAU_PREPARE1", player); - BauSystem.MESSAGE.send("LAUFBAU_PREPARE2", player); - } - - @Register - public void laufbauSelection(Player player, /*@Mapper("block") Material blockMaterial, @Mapper("slab") Material slabMaterial*/ boolean preferingBlastResistance) { + @Register(description = {"LAUFBAU_HELP", "LAUFBAU_PREPARE1", "LAUFBAU_PREPARE2"}) + public void laufbauSelection(Player player, @StaticValue(value = {"smallest", "blastresistant"}, allowISE = true) boolean preferingBlastResistance) { if (!permissionCheck(player, Permission.WORLDEDIT)) { return; } @@ -91,60 +76,10 @@ public class LaufbauCommand extends SWCommand { break; } } - SWUtils.sendToActionbar(player, laufbau.actionBarMessage(player)); + Bukkit.getOnlinePlayers().forEach(p -> { + SWUtils.sendToActionbar(p, laufbau.actionBarMessage(p)); + }); } }.runTaskTimer(BauSystem.getInstance(), 1, 1); } - - @Mapper(value = "block", local = true) - private TypeMapper blockMapper() { - Set strings = new HashSet<>(); - for (Material material : Material.values()) { - if (!material.isBlock()) { - continue; - } - strings.add(material.name().toLowerCase()); - } - return new TypeMapper() { - @Override - public List tabCompletes(CommandSender commandSender, String[] ignored, String s) { - return new ArrayList<>(strings); - } - - @Override - public Material map(CommandSender commandSender, String[] previousArguments, String s) { - if (strings.contains(s.toLowerCase())) { - return Material.valueOf(s.toUpperCase()); - } - return null; - } - }; - } - - @Mapper(value = "slab", local = true) - private TypeMapper slabMapper() { - Set strings = new HashSet<>(); - for (Material material : Material.values()) { - if (!material.isBlock()) { - continue; - } - if (material.name().contains("STAIRS") || material.name().contains("SLAB")) { - strings.add(material.name().toLowerCase()); - } - } - return new TypeMapper() { - @Override - public List tabCompletes(CommandSender commandSender, String[] ignored, String s) { - return new ArrayList<>(strings); - } - - @Override - public Material map(CommandSender commandSender, String[] previousArguments, String s) { - if (strings.contains(s.toLowerCase())) { - return Material.valueOf(s.toUpperCase()); - } - return null; - } - }; - } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java index 2652fe4e..436d6214 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/panzern/PanzernCommand.java @@ -27,6 +27,7 @@ import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.shared.Pair; import de.steamwar.command.*; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.command.CommandSender; @@ -79,7 +80,10 @@ public class PanzernCommand extends SWCommand { break; } } - SWUtils.sendToActionbar(player, BauSystem.MESSAGE.parse("PANZERN_PROGRESS", player, panzern.blocksLeft(), blocks * 20, panzern.blocksLeft() - blockLeft)); + long finalBlocks = blocks; + Bukkit.getOnlinePlayers().forEach(p -> { + SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("PANZERN_PROGRESS", p, panzern.blocksLeft(), finalBlocks * 20, panzern.blocksLeft() - blockLeft)); + }); } }.runTaskTimer(BauSystem.getInstance(), 1, 1); }