From d75d48d13d46aad358344c1fdec817b916ba1717 Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 18 Aug 2021 17:32:05 +0200 Subject: [PATCH] Fixed crash with axolotl disguises --- .../unicopia/entity/behaviour/AxolotlBehaviour.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/AxolotlBehaviour.java b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/AxolotlBehaviour.java index 797dd888..e9738a87 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/behaviour/AxolotlBehaviour.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/behaviour/AxolotlBehaviour.java @@ -6,9 +6,12 @@ import net.minecraft.entity.passive.AxolotlEntity; import net.minecraft.util.math.Vec3f; public class AxolotlBehaviour extends EntityBehaviour { + private static final float toRad = 0.017453292F; @Override public void update(Caster source, AxolotlEntity entity, DisguiseSpell spell) { - float toRad = 0.017453292F; + if (entity.getModelAngles().isEmpty()) { + return; + } Vec3f current = entity.getModelAngles().get("body"); entity.getModelAngles().put("body", new Vec3f( source.getEntity().isSubmergedInWater() ? source.getEntity().getPitch() * toRad : 0,