From d07a86c13fd2188631dda0ef914cd541f718cf50 Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Thu, 21 May 2026 18:41:55 +0200 Subject: [PATCH] remove container hiding as it has no lacalaity mapping posibility --- .../fightsystem/utils/TechHiderWrapper.java | 10 ------ .../src/de/steamwar/techhider/TechHider.java | 33 +++---------------- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHiderWrapper.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHiderWrapper.java index 15853d7c..193f851b 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHiderWrapper.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHiderWrapper.java @@ -107,16 +107,6 @@ public class TechHiderWrapper extends StateDependent implements Listener { Region hiddenRegion = getHiddenRegion(p); return !hiddenRegion.inRegion(blockX, blockY, blockZ) || !blockEntityTypeToObfuscate.contains(type); } - - @Override - public boolean isPlayerPrivilegedToAccessContainer(Player p, int containerId) { - return true; - } - - @Override - public boolean isPlayerPrivilegedToAccessSound(Player p, ResourceLocation soundId) { - return true; - } }; new StateDependentListener(ENABLED, FightState.Schem, this); diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java index dab7bf8a..4d848379 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java @@ -180,7 +180,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 @@ -188,9 +188,11 @@ public abstract class TechHider { ClientboundPlayerInfoRemovePacket.class, // 7.1.68 Player Info Remove ClientboundPlayerInfoUpdatePacket.class, // 7.1.69 Player Info Update ClientboundMoveVehiclePacket.class, // 7.1.56 Move Vehicle (vehicle the player is in) - ClientboundStopSoundPacket.class // 7.1.118 Stop Sound: sound state side channel - + ClientboundStopSoundPacket.class, // 7.1.118 Stop Sound: sound state side channel + ClientboundContainerSetContentPacket.class, // 7.1.19 Set Container Content + ClientboundContainerSetDataPacket.class, // 7.1.20 Set Container Property + ClientboundContainerSetSlotPacket.class // 7.1.21 Set Container Slot )); BiFunction, Packet> tossPacket = (p, packet) -> null; @@ -276,14 +278,6 @@ public abstract class TechHider { // 7.1.48 Update Light: lighting can reveal hidden blocks/operations. processors.put(ClientboundLightUpdatePacket.class, tossPacket); - // --- Container packets --- - // 7.1.19 Set Container Content - processors.put(ClientboundContainerSetContentPacket.class, buildContainerPacketProcessor(ClientboundContainerSetContentPacket::containerId)); - // 7.1.20 Set Container Property - processors.put(ClientboundContainerSetDataPacket.class, buildContainerPacketProcessor(ClientboundContainerSetDataPacket::getContainerId)); - // 7.1.21 Set Container Slot - processors.put(ClientboundContainerSetSlotPacket.class, buildContainerPacketProcessor(ClientboundContainerSetSlotPacket::getContainerId)); - // --- Sound packets --- // 7.1.115 Entity Sound Effect: entity id and sound. processors.put(ClientboundSoundEntityPacket.class, this.buildEntityPacketProcessor(ClientboundSoundEntityPacket::getId)); @@ -545,21 +539,6 @@ public abstract class TechHider { return chunkHider.processLevelChunkWithLightPacket(p, packet); } - private Packet processContainerPacket(Player player, int containerId, Packet packet) { - if(isPlayerPrivilegedToAccessContainer(player, containerId)) { - return packet; - } else { - return null; - } - } - private > BiFunction, Packet> buildContainerPacketProcessor(ToIntFunction containerIdExtractor) { - return (p, rawPacket) -> { - TTargetPacket packet = (TTargetPacket) rawPacket; - - return processContainerPacket(p, containerIdExtractor.applyAsInt(packet), packet); - }; - } - private Packet proccessPositionBasedPacket(Player player, int blockX, int blockY, int blockZ, Packet packet) { if(isPlayerPrivilegedToAccessPosition(player, blockX, blockY, blockZ)) { return packet; @@ -583,6 +562,4 @@ public abstract class TechHider { public abstract boolean isPlayerPrivilegedToAccessBlock(Player p, int blockX, int blockY, int blockZ, Block block); 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); }