Fixed disguises not being rotated properly when using mine little pony

This commit is contained in:
Sollace 2021-08-18 20:13:52 +02:00
parent 8081d4c1a6
commit ab442461d3

View file

@ -3,6 +3,7 @@ package com.minelittlepony.unicopia.client.minelittlepony;
import com.minelittlepony.api.model.IModel;
import com.minelittlepony.api.model.ModelAttributes;
import com.minelittlepony.api.model.fabric.PonyModelPrepareCallback;
import com.minelittlepony.unicopia.Owned;
import com.minelittlepony.unicopia.Unicopia;
import com.minelittlepony.unicopia.entity.player.Pony;
@ -20,10 +21,14 @@ public class Main implements ClientModInitializer {
PonyModelPrepareCallback.EVENT.register(this::onPonyModelPrepared);
}
@SuppressWarnings("unchecked")
private void onPonyModelPrepared(Entity entity, IModel model, ModelAttributes.Mode mode) {
if (hookErroring) return;
try {
if (entity instanceof PlayerEntity) {
if (entity instanceof Owned) {
entity = ((Owned<PlayerEntity>)entity).getMaster();
}
Pony pony = Pony.of((PlayerEntity)entity);
if (pony.getMotion().isFlying()) {