forked from SteamWar/SteamWar
Add new handler
This commit is contained in:
@@ -369,7 +369,7 @@ public abstract class TechHider {
|
|||||||
|
|
||||||
// --- Particle packets ---
|
// --- Particle packets ---
|
||||||
// 7.1.47 Particle: particle type and position can reveal hidden machinery.
|
// 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 ---
|
// --- Lighting packets ---
|
||||||
// 7.1.48 Update Light: lighting can reveal hidden blocks/operations.
|
// 7.1.48 Update Light: lighting can reveal hidden blocks/operations.
|
||||||
@@ -604,6 +604,19 @@ public abstract class TechHider {
|
|||||||
newStates);
|
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 final ChunkHider chunkHider = new ChunkHider();
|
||||||
|
|
||||||
private ClientboundLevelChunkWithLightPacket processChunkWithLight(Player p, ClientboundLevelChunkWithLightPacket packet) {
|
private ClientboundLevelChunkWithLightPacket processChunkWithLight(Player p, ClientboundLevelChunkWithLightPacket packet) {
|
||||||
|
|||||||
Reference in New Issue
Block a user