mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Fix error when updating pony model for a disguise player entity
This commit is contained in:
parent
67a894958c
commit
a8e1c66e0f
1 changed files with 2 additions and 3 deletions
|
@ -37,13 +37,12 @@ public class Main extends MineLPDelegate implements ClientModInitializer {
|
||||||
IGear.register(GlassesGear::new);
|
IGear.register(GlassesGear::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private void onPonyModelPrepared(Entity entity, IModel model, ModelAttributes.Mode mode) {
|
private void onPonyModelPrepared(Entity entity, IModel model, ModelAttributes.Mode mode) {
|
||||||
if (hookErroring) return;
|
if (hookErroring) return;
|
||||||
try {
|
try {
|
||||||
if (entity instanceof PlayerEntity) {
|
if (entity instanceof PlayerEntity) {
|
||||||
if (entity instanceof Owned) {
|
if (entity instanceof Owned<?> o && o.getMaster() instanceof PlayerEntity master) {
|
||||||
entity = ((Owned<PlayerEntity>)entity).getMaster();
|
entity = master;
|
||||||
}
|
}
|
||||||
Pony pony = Pony.of((PlayerEntity)entity);
|
Pony pony = Pony.of((PlayerEntity)entity);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue