mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-21 23:51:36 +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()) {
|
if (hasPassenger()) {
|
||||||
getPassengers().forEach(this::removePassenger);
|
getPassengers().forEach(this::removePassenger);
|
||||||
}
|
}
|
||||||
|
var vehicle = this.vehicle;
|
||||||
|
if (vehicle != null) {
|
||||||
|
vehicle.removePassenger(this);
|
||||||
|
}
|
||||||
MinecraftServer.getUpdateManager().getThreadProvider().removeEntity(this);
|
MinecraftServer.getUpdateManager().getThreadProvider().removeEntity(this);
|
||||||
this.removed = true;
|
this.removed = true;
|
||||||
this.shouldRemove = true;
|
this.shouldRemove = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user