Fixed crash with axolotl disguises

This commit is contained in:
Sollace 2021-08-18 17:32:05 +02:00
parent b4b567c647
commit d75d48d13d

View file

@ -6,9 +6,12 @@ import net.minecraft.entity.passive.AxolotlEntity;
import net.minecraft.util.math.Vec3f;
public class AxolotlBehaviour extends EntityBehaviour<AxolotlEntity> {
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,