Drop carried entities switching to a species that's not supposed to be able to carry other entities

This commit is contained in:
Sollace 2022-12-25 23:23:11 +01:00
parent 67a7c9f16e
commit fc14f51859

View file

@ -165,6 +165,14 @@ public abstract class Living<T extends LivingEntity> implements Equine<T>, Caste
}
if (isBeingCarried()) {
Pony carrier = Pony.of(entity.getVehicle()).orElse(null);
if (!carrier.getCompositeRace().any(Abilities.CARRY::canUse)) {
entity.stopRiding();
entity.refreshPositionAfterTeleport(carrier.getOriginVector());
Living.transmitPassengers(carrier.asEntity());
}
}
updateDragonBreath();