forked from SteamWar/SteamWar
fix entities not despawning
This commit is contained in:
+3
-2
@@ -59,7 +59,7 @@ public class TechHiderWrapper extends StateDependent implements Listener {
|
|||||||
|
|
||||||
|
|
||||||
public TechHiderWrapper(HullHider hullHider) {
|
public TechHiderWrapper(HullHider hullHider) {
|
||||||
super(ENABLED, FightState.Schem);
|
super(ENABLED, FightState.All);
|
||||||
Set<Block> blocksToObfuscate = Config.GameModeConfig.Techhider.HiddenBlocks.stream()
|
Set<Block> blocksToObfuscate = Config.GameModeConfig.Techhider.HiddenBlocks.stream()
|
||||||
.map(CraftMagicNumbers::getBlock)
|
.map(CraftMagicNumbers::getBlock)
|
||||||
.collect(Collectors.toUnmodifiableSet());
|
.collect(Collectors.toUnmodifiableSet());
|
||||||
@@ -90,6 +90,7 @@ public class TechHiderWrapper extends StateDependent implements Listener {
|
|||||||
return !hiddenRegion.inRegion(blockX, blockY, blockZ) || !blocksToObfuscate.contains(block);
|
return !hiddenRegion.inRegion(blockX, blockY, blockZ) || !blocksToObfuscate.contains(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO will require entity tracking on the netty thread to prevent future race conditions
|
||||||
@Override
|
@Override
|
||||||
public boolean isPlayerPrivilegedToAccessEntity(Player p, int entityId) {
|
public boolean isPlayerPrivilegedToAccessEntity(Player p, int entityId) {
|
||||||
net.minecraft.world.entity.Entity nmsEntity = ((CraftWorld) p.getWorld()).getHandle().moonrise$getEntityLookup().get(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());
|
return !hullHider.isBlockHidden(p, nmsEntity.getBlockX(), nmsEntity.getBlockY(), nmsEntity.getBlockZ());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ tasks.register<FightServer>("WarGear21") {
|
|||||||
dependsOn(":KotlinCore:shadowJar")
|
dependsOn(":KotlinCore:shadowJar")
|
||||||
template = "WarGear21"
|
template = "WarGear21"
|
||||||
worldName = "arenas/Pentraki"
|
worldName = "arenas/Pentraki"
|
||||||
config = "WarGear20.yml"
|
config = "WarGear21.yml"
|
||||||
jar = "/jars/paper-1.21.6.jar"
|
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)
|
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
|
||||||
|
|
||||||
|
ClientboundLightUpdatePacket.class, // 7.1.48 Update Light
|
||||||
|
|
||||||
ClientboundContainerSetContentPacket.class, // 7.1.19 Set Container Content
|
ClientboundContainerSetContentPacket.class, // 7.1.19 Set Container Content
|
||||||
ClientboundContainerSetDataPacket.class, // 7.1.20 Set Container Property
|
ClientboundContainerSetDataPacket.class, // 7.1.20 Set Container Property
|
||||||
ClientboundContainerSetSlotPacket.class // 7.1.21 Set Container Slot
|
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.
|
// 7.1.47 Particle: particle type and position can reveal hidden machinery.
|
||||||
processors.put(ClientboundLevelParticlesPacket.class, (p, packet) -> processLevelParticlesPacket(p, (ClientboundLevelParticlesPacket) packet));
|
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 ---
|
// --- Sound packets ---
|
||||||
// 7.1.115 Entity Sound Effect: entity id and sound.
|
// 7.1.115 Entity Sound Effect: entity id and sound.
|
||||||
processors.put(ClientboundSoundEntityPacket.class, this.buildEntityPacketProcessor(ClientboundSoundEntityPacket::getId));
|
processors.put(ClientboundSoundEntityPacket.class, this.buildEntityPacketProcessor(ClientboundSoundEntityPacket::getId));
|
||||||
|
|||||||
Reference in New Issue
Block a user