mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +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) {
|
||||
UUID carrierId = getCarrierId().get();
|
||||
Entity carrier = ((ServerWorld)asWorld()).getEntity(carrierId);
|
||||
asEntity().startRiding(carrier, true);
|
||||
Living.transmitPassengers(carrier);
|
||||
if (carrier != null) {
|
||||
asEntity().startRiding(carrier, true);
|
||||
Living.transmitPassengers(carrier);
|
||||
} else {
|
||||
Unicopia.LOGGER.warn("No passenger with id {]", carrierId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue