From 1ef29e4eb5904410a58a1d556857ca036b70032e Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 26 Feb 2023 00:37:56 +0000 Subject: [PATCH] Fixed crash when a player rejoins a world with an entity in their arms --- .../java/com/minelittlepony/unicopia/entity/Living.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Living.java b/src/main/java/com/minelittlepony/unicopia/entity/Living.java index 8cc4616e..9c46ac67 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Living.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Living.java @@ -154,8 +154,12 @@ public abstract class Living implements Equine, 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); + } } }