mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Fixed crash when a player rejoins a world with an entity in their arms
This commit is contained in:
parent
65201baa62
commit
1ef29e4eb5
1 changed files with 6 additions and 2 deletions
|
@ -154,8 +154,12 @@ public abstract class Living<T extends LivingEntity> implements Equine<T>, Caste
|
||||||
if (!entity.hasVehicle() && getCarrierId().isPresent() && !asWorld().isClient && entity.age % 10 == 0) {
|
if (!entity.hasVehicle() && getCarrierId().isPresent() && !asWorld().isClient && entity.age % 10 == 0) {
|
||||||
UUID carrierId = getCarrierId().get();
|
UUID carrierId = getCarrierId().get();
|
||||||
Entity carrier = ((ServerWorld)asWorld()).getEntity(carrierId);
|
Entity carrier = ((ServerWorld)asWorld()).getEntity(carrierId);
|
||||||
|
if (carrier != null) {
|
||||||
asEntity().startRiding(carrier, true);
|
asEntity().startRiding(carrier, true);
|
||||||
Living.transmitPassengers(carrier);
|
Living.transmitPassengers(carrier);
|
||||||
|
} else {
|
||||||
|
Unicopia.LOGGER.warn("No passenger with id {]", carrierId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue