diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java index fee15416..a6442669 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java @@ -48,9 +48,10 @@ public class KillcheckerCommand extends SWCommand implements Listener { } @Register(value = "enable", description = "KILLCHECKER_HELP_ENABLE") - public void genericCommand(Player player) { + public void genericCommand(Player player, @OptionalValue("ALL_CUBOIDS") ColorizedCuboidsOnly colorizedCuboidsOnly) { Region region = Region.getRegion(player.getLocation()); KillcheckerVisualizer killcheckerVisualizer = visualizers.computeIfAbsent(region, KillcheckerVisualizer::new); + killcheckerVisualizer.setOnlyColorizedBlocks(colorizedCuboidsOnly == ColorizedCuboidsOnly.ONLY_COLORIZED_CUBOIDS); killcheckerVisualizer.recalc(); killcheckerVisualizer.show(player); BauSystem.MESSAGE.send("KILLCHECKER_ENABLE", player); @@ -99,4 +100,9 @@ public class KillcheckerCommand extends SWCommand implements Listener { recalc(event.getBlock()); }, 1); } + + public enum ColorizedCuboidsOnly { + ONLY_COLORIZED_CUBOIDS, + ALL_CUBOIDS + } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerVisualizer.java b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerVisualizer.java index e97f4a30..638cc955 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerVisualizer.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerVisualizer.java @@ -27,6 +27,7 @@ import de.steamwar.bausystem.region.utils.RegionType; import de.steamwar.entity.REntity; import de.steamwar.entity.REntityServer; import de.steamwar.entity.RFallingBlockEntity; +import lombok.Setter; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.World; @@ -55,6 +56,9 @@ public class KillcheckerVisualizer { private REntityServer rEntityServer = new REntityServer(); + @Setter + private boolean onlyColorizedBlocks = false; + private Map killCount = new HashMap<>(); private Map rEntities = new HashMap<>(); @@ -67,6 +71,10 @@ public class KillcheckerVisualizer { if (points.contains(new Point(x, y, z))) continue; Block block = WORLD.getBlockAt(x, y, z); if (block.getType().isAir()) continue; + if (onlyColorizedBlocks) { + String name = block.getType().name(); + if (!name.endsWith("_WOOL") && name.endsWith("_STAINED_GLASS") && !name.endsWith("_CONCRETE") && !name.endsWith("_TERRACOTTA")) continue; + } Cuboid cuboid = create(block.getType(), x, y, z); cuboids.add(cuboid); for (int dx = (int) cuboid.getX(); dx <= cuboid.getDx(); dx++) {