From 9f319128cc6ff2843270ff0d4a5ede5eb11bb71f Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Sun, 17 May 2026 13:49:46 +0200 Subject: [PATCH] Update multiblock update packet filter --- .../src/de/steamwar/techhider/TechHider.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java index c3a467cc..61358c26 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java @@ -15,6 +15,7 @@ import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; import it.unimi.dsi.fastutil.shorts.ShortArraySet; import it.unimi.dsi.fastutil.shorts.ShortSets; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.repository.Pack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.phys.Vec3; @@ -299,7 +300,7 @@ public abstract class TechHider { ClientboundBlockChangedAckPacket.class, // 7.1.5 Acknowledge Block Change ClientboundChunkBatchFinishedPacket.class, // 7.1.12 Chunk Batch Finished (Delimiter) ClientboundChunkBatchStartPacket.class, // 7.1.13 Chunk Batch Start (Delimiter) - ClientboundChunksBiomesPacket.class, // 7.1.14 Chunk Biomes + // ClientboundChunksBiomesPacket.class, // 7.1.14 Chunk Biomes ClientboundContainerClosePacket.class, // 7.1.18 Close Container ClientboundSetChunkCacheCenterPacket.class, // 7.1.93 Set Center Chunk ClientboundForgetLevelChunkPacket.class, // 7.1.38 Unload Chunk @@ -571,26 +572,18 @@ public abstract class TechHider { for (int i = 0; i < oldPos.length; i++) { short posShort = oldPos[i]; BlockState state = oldStates[i]; + Block block = state.getBlock(); int worldX = sectionPos.relativeToBlockX(posShort); int worldY = sectionPos.relativeToBlockY(posShort); int worldZ = sectionPos.relativeToBlockZ(posShort); - BlockPos pos = new BlockPos(worldX, worldY, worldZ); - - if (isPlayerPrivilegedToAccessBlockPos(p, pos.getX(), pos.getY(), pos.getZ())) { + if (isPlayerPrivilegedToAccessPosition(p, worldX, worldY, worldZ) && isPlayerPrivilegedToAccessBlock(p, worldX, worldY, worldZ, block)) { filteredPos.add(posShort); filteredStates.add(state); - } else { - int id = Block.getId(state); - if (blockIdsToObfuscate.contains(id)) { - filteredPos.add(posShort); - filteredStates.add(blockToObfuscateTo); - modified = true; - } else { - filteredPos.add(posShort); - filteredStates.add(state); - } + } else if(isPlayerPrivilegedToAccessPosition(p, worldX, worldY, worldZ)){ + filteredPos.add(posShort); + filteredStates.add(blockStateUsedForObfuscation); } } @@ -672,4 +665,5 @@ public abstract class TechHider { public abstract boolean isPlayerPrivilegedToAccessEntity(Player p, int entityId); public abstract boolean isPlayerPrivilegedToAccessBlocEntity(Player p, int blockX, int blockY, int blockZ, BlockEntityType type); public abstract boolean isPlayerPrivilegedToAccessContainer(Player p, int containerId); + public abstract boolean isPlayerPrivilegedToAccessSound(Player p, ResourceLocation soundId); }