Purge hidden entities on unload too

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-12-04 08:23:26 +11:00
parent 4f6a5feac8
commit 6646c417c5
3 changed files with 12 additions and 5 deletions

View File

@@ -592,11 +592,18 @@
}
public void onTrackingEnd(Entity entity) {
@@ -1664,6 +1877,7 @@
@@ -1664,6 +1877,14 @@
gameeventlistenerregistrar.onListenerRemoved(entity.level);
}
+ entity.valid = false; // CraftBukkit
+ // CraftBukkit start
+ entity.valid = false;
+ if (!(entity instanceof EntityPlayer)) {
+ for (EntityPlayer player : players) {
+ player.getBukkitEntity().onEntityRemove(entity);
+ }
+ }
+ // CraftBukkit end
}
}
}