Remove passengers in Entity#remove

This commit is contained in:
TheMode 2021-07-30 12:38:15 +02:00
parent fb23b4bc27
commit 184140e341
1 changed files with 4 additions and 0 deletions

View File

@ -1506,6 +1506,10 @@ public class Entity implements Viewable, Tickable, EventHandler<EntityEvent>, Da
if (isRemoved())
return;
// Remove passengers if any (also done with LivingEntity#kill)
if (hasPassenger()) {
getPassengers().forEach(this::removePassenger);
}
MinecraftServer.getUpdateManager().getThreadProvider().removeEntity(this);
this.removed = true;
this.shouldRemove = true;