diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/EntityShowMode.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/EntityShowMode.java index 6f61a08e..0828ce73 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/EntityShowMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/EntityShowMode.java @@ -29,7 +29,6 @@ import de.steamwar.entity.REntityServer; import de.steamwar.entity.RFallingBlockEntity; import net.md_5.bungee.api.chat.ClickEvent; import org.bukkit.Material; -import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -85,6 +84,10 @@ public class EntityShowMode implements ShowMode { return; } + if (showModeParameter.isMicroMotion() && !position.getRecord().isHasMicroMotion()) { + return; + } + if (showModeParameter.isExplodeOnly()) { if (position.isExploded()) { generatePositions(position, false, false); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/Record.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/Record.java index 71b19f1d..08bc6561 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/Record.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/Record.java @@ -75,6 +75,9 @@ public class Record { @Setter private boolean inBuildArea = false; + @Getter + private boolean hasMicroMotion = false; + public TNTRecord(long offset, Region region) { this.offset = offset; this.region = region; @@ -90,6 +93,11 @@ public class Record { public void explode(TNTPrimed tntPrimed) { add(tntPrimed, false, true); + Vector velocity = tntPrimed.getVelocity(); + if (velocity.getY() != 0) return; + if (velocity.getX() > 0.001 || velocity.getZ() > 0.001) return; + if (velocity.getX() == 0 && velocity.getZ() == 0) return; + hasMicroMotion = true; } private void add(TNTPrimed tntPrimed, boolean source, boolean exploded) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameter.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameter.java index 4babe506..802c1eba 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameter.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameter.java @@ -32,6 +32,7 @@ public class ShowModeParameter { private boolean count = false; private boolean buildDestroyOnly = false; private boolean ticksSinceStart = false; + private boolean microMotion = false; public void enableWater() { this.water = true; @@ -68,4 +69,8 @@ public class ShowModeParameter { public void enableTicksSinceStart() { this.ticksSinceStart = true; } + + public void enableMicroMotion() { + this.microMotion = true; + } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameterType.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameterType.java index a80a3633..897fcff6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameterType.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameterType.java @@ -41,7 +41,9 @@ public enum ShowModeParameterType { TICKS(ShowModeParameter::enableTicks, Arrays.asList("-ticks", "-t"), "EXPLODE", "SOURCE", "COUNT", "TICKS_SINCE_START"), COUNT(ShowModeParameter::enableCount, Arrays.asList("-count", "-c"), "TICKS", "TICKS_SINCE_START"), BUILD_DESTROY_ONLY(ShowModeParameter::enableBuildDestroyOnly, Arrays.asList("-builddestroy", "-builddestoryonly"), "WATER"), - TICKS_SINCE_START(ShowModeParameter::enableTicksSinceStart, Arrays.asList("-tickssincestart", "-tss"), "TICKS", "COUNT"); + TICKS_SINCE_START(ShowModeParameter::enableTicksSinceStart, Arrays.asList("-tickssincestart", "-tss"), "TICKS", "COUNT"), + MICROMOTION(ShowModeParameter::enableMicroMotion, Arrays.asList("-micromotion", "-micro", "-m"), "COUNT"), + ; @Getter private final Consumer showModeParameterConsumer;