From 7e18207b87e42b3cf406f78bac7c0a6693d63b56 Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Fri, 22 May 2026 16:32:49 +0200 Subject: [PATCH] fix entities not despawning --- .../src/de/steamwar/fightsystem/utils/TechHiderWrapper.java | 5 +++-- FightSystem/build.gradle.kts | 2 +- .../src/de/steamwar/techhider/TechHider.java | 6 ++---- 3 files changed, 6 insertions(+), 7 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 193f851b..fb2dc750 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHiderWrapper.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHiderWrapper.java @@ -59,7 +59,7 @@ public class TechHiderWrapper extends StateDependent implements Listener { public TechHiderWrapper(HullHider hullHider) { - super(ENABLED, FightState.Schem); + super(ENABLED, FightState.All); Set blocksToObfuscate = Config.GameModeConfig.Techhider.HiddenBlocks.stream() .map(CraftMagicNumbers::getBlock) .collect(Collectors.toUnmodifiableSet()); @@ -90,6 +90,7 @@ public class TechHiderWrapper extends StateDependent implements Listener { return !hiddenRegion.inRegion(blockX, blockY, blockZ) || !blocksToObfuscate.contains(block); } + // TODO will require entity tracking on the netty thread to prevent future race conditions @Override public boolean isPlayerPrivilegedToAccessEntity(Player p, int entityId) { net.minecraft.world.entity.Entity nmsEntity = ((CraftWorld) p.getWorld()).getHandle().moonrise$getEntityLookup().get(entityId); @@ -98,7 +99,7 @@ public class TechHiderWrapper extends StateDependent implements Listener { return !hullHider.isBlockHidden(p, nmsEntity.getBlockX(), nmsEntity.getBlockY(), nmsEntity.getBlockZ()); } else { - return false; + return true; } } diff --git a/FightSystem/build.gradle.kts b/FightSystem/build.gradle.kts index a9a84cbd..c6b14b8b 100644 --- a/FightSystem/build.gradle.kts +++ b/FightSystem/build.gradle.kts @@ -60,7 +60,7 @@ tasks.register("WarGear21") { dependsOn(":KotlinCore:shadowJar") template = "WarGear21" worldName = "arenas/Pentraki" - config = "WarGear20.yml" + config = "WarGear21.yml" jar = "/jars/paper-1.21.6.jar" } diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java index 4d848379..7d92284f 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java @@ -190,6 +190,8 @@ public abstract class TechHider { ClientboundMoveVehiclePacket.class, // 7.1.56 Move Vehicle (vehicle the player is in) ClientboundStopSoundPacket.class, // 7.1.118 Stop Sound: sound state side channel + ClientboundLightUpdatePacket.class, // 7.1.48 Update Light + ClientboundContainerSetContentPacket.class, // 7.1.19 Set Container Content ClientboundContainerSetDataPacket.class, // 7.1.20 Set Container Property ClientboundContainerSetSlotPacket.class // 7.1.21 Set Container Slot @@ -274,10 +276,6 @@ public abstract class TechHider { // 7.1.47 Particle: particle type and position can reveal hidden machinery. processors.put(ClientboundLevelParticlesPacket.class, (p, packet) -> processLevelParticlesPacket(p, (ClientboundLevelParticlesPacket) packet)); - // --- Lighting packets --- - // 7.1.48 Update Light: lighting can reveal hidden blocks/operations. - processors.put(ClientboundLightUpdatePacket.class, tossPacket); - // --- Sound packets --- // 7.1.115 Entity Sound Effect: entity id and sound. processors.put(ClientboundSoundEntityPacket.class, this.buildEntityPacketProcessor(ClientboundSoundEntityPacket::getId));