mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-21 15:41:38 +01:00
Remove vehicle in Entity#remove
This commit is contained in:
parent
184140e341
commit
d7a6891153
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user