diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java index 70649d41..7583de12 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java @@ -369,7 +369,7 @@ public abstract class TechHider { // --- Particle packets --- // 7.1.47 Particle: particle type and position can reveal hidden machinery. - processors.put(ClientboundLevelParticlesPacket.class, tossPacket); + processors.put(ClientboundLevelParticlesPacket.class, (p, packet) -> processLevelParticlesPacket(p, (ClientboundLevelParticlesPacket) packet)); // --- Lighting packets --- // 7.1.48 Update Light: lighting can reveal hidden blocks/operations. @@ -604,6 +604,19 @@ public abstract class TechHider { newStates); } + private Packet processLevelParticlesPacket(Player player, ClientboundLevelParticlesPacket packet) { + int blockX = (int) packet.getX(); + int blockY = (int) packet.getY(); + int blockZ = (int) packet.getZ(); + + if(isPlayerPrivilegedToAccessPosition(player, blockX, blockY, blockZ)) { + return packet; + } + else { + return null; + } + } + private final ChunkHider chunkHider = new ChunkHider(); private ClientboundLevelChunkWithLightPacket processChunkWithLight(Player p, ClientboundLevelChunkWithLightPacket packet) {