Remove vehicle in Entity#remove

This commit is contained in:
TheMode 2021-07-30 14:01:54 +02:00
parent 184140e341
commit d7a6891153

View File

@ -1510,6 +1510,10 @@ public class Entity implements Viewable, Tickable, EventHandler<EntityEvent>, Da
if (hasPassenger()) {
getPassengers().forEach(this::removePassenger);
}
var vehicle = this.vehicle;
if (vehicle != null) {
vehicle.removePassenger(this);
}
MinecraftServer.getUpdateManager().getThreadProvider().removeEntity(this);
this.removed = true;
this.shouldRemove = true;