fix entities not despawning

This commit is contained in:
D4rkr34lm
2026-05-22 16:32:49 +02:00
parent 72b23ad116
commit 7e18207b87
3 changed files with 6 additions and 7 deletions
@@ -59,7 +59,7 @@ public class TechHiderWrapper extends StateDependent implements Listener {
public TechHiderWrapper(HullHider hullHider) {
super(ENABLED, FightState.Schem);
super(ENABLED, FightState.All);
Set<Block> 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;
}
}
+1 -1
View File
@@ -60,7 +60,7 @@ tasks.register<FightServer>("WarGear21") {
dependsOn(":KotlinCore:shadowJar")
template = "WarGear21"
worldName = "arenas/Pentraki"
config = "WarGear20.yml"
config = "WarGear21.yml"
jar = "/jars/paper-1.21.6.jar"
}
@@ -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));