Null check tracker in Entity#resendPossiblyDesyncedEntityData

Accidentally dropped this check last commit. It is possible
that this is called while the entity is not tracked.
This commit is contained in:
Spottedleaf 2024-07-28 15:49:38 -07:00
parent 3badc8385a
commit ce8b79d47e

View file

@ -138,6 +138,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (player.getBukkitEntity().canSee(this.getBukkitEntity())) {
+ ServerLevel world = (net.minecraft.server.level.ServerLevel)this.level();
+ net.minecraft.server.level.ChunkMap.TrackedEntity tracker = world == null ? null : world.getChunkSource().chunkMap.entityMap.get(this.getId());
+ if (tracker == null) {
+ return;
+ }
+ final net.minecraft.server.level.ServerEntity serverEntity = tracker.serverEntity;
+ final List<net.minecraft.network.protocol.Packet<? super net.minecraft.network.protocol.game.ClientGamePacketListener>> list = new java.util.ArrayList<>();
+ serverEntity.sendPairingData(player, list::add);