Fix some axolotl angles

This commit is contained in:
Sollace 2021-08-08 19:21:14 +02:00
parent caf0175155
commit e080084830
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,19 @@
package com.minelittlepony.unicopia.entity.behaviour;
import com.minelittlepony.unicopia.ability.magic.Caster;
import com.minelittlepony.unicopia.ability.magic.spell.DisguiseSpell;
import net.minecraft.entity.passive.AxolotlEntity;
import net.minecraft.util.math.Vec3f;
public class AxolotlBehaviour extends EntityBehaviour<AxolotlEntity> {
@Override
public void update(Caster<?> source, AxolotlEntity entity, DisguiseSpell spell) {
float toRad = 0.017453292F;
Vec3f current = entity.getModelAngles().get("body");
entity.getModelAngles().put("body", new Vec3f(
source.getEntity().isSubmergedInWater() ? source.getEntity().getPitch() * toRad : 0,
0,
current == null ? 0 : current.getZ()
));
}
}

View file

@ -274,6 +274,7 @@ public class EntityBehaviour<T extends Entity> {
register(SheepBehaviour::new, EntityType.SHEEP);
register(BeeBehaviour::new, EntityType.BEE);
register(GhastBehaviour::new, EntityType.GHAST);
register(AxolotlBehaviour::new, EntityType.AXOLOTL);
register(EndermanBehaviour::new, EntityType.ENDERMAN);
EntityBehaviour.<LlamaEntity>register(() -> new RangedAttackBehaviour<>(SoundEvents.ENTITY_LLAMA_SPIT, LlamaSpitEntity::new), EntityType.LLAMA, EntityType.TRADER_LLAMA);
EntityBehaviour.<SnowGolemEntity>register(() -> new RangedAttackBehaviour<>(SoundEvents.ENTITY_SNOW_GOLEM_SHOOT, SnowballEntity::new), EntityType.SNOW_GOLEM);