From d881fc1a5d9e72d363fca659e5a0105a72374b4f Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 11 Apr 2023 16:40:33 +0200 Subject: [PATCH] Fixed hippogriffs not using the correct models --- .../minelittlepony/client/model/ModelType.java | 8 ++++++-- .../render/entity/PlayerSeaponyRenderer.java | 15 ++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/minelittlepony/client/model/ModelType.java b/src/main/java/com/minelittlepony/client/model/ModelType.java index 40d5d89e..5350914d 100644 --- a/src/main/java/com/minelittlepony/client/model/ModelType.java +++ b/src/main/java/com/minelittlepony/client/model/ModelType.java @@ -71,9 +71,13 @@ public final class ModelType { public static final PlayerModelKey> KIRIN = registerPlayer("kirin", Race.KIRIN, KirinModel::new); public static final PlayerModelKey> PEGASUS = registerPlayer("pegasus", Race.PEGASUS, PegasusModel::new); public static final PlayerModelKey> GRYPHON = registerPlayer("gryphon", Race.GRYPHON, PegasusModel::new); - public static final PlayerModelKey> HIPPOGRIFF = registerPlayer("hippogriff", Race.HIPPOGRIFF, PegasusModel::new, PonyArmourModel::new, PlayerSeaponyRenderer::new); + public static final PlayerModelKey> HIPPOGRIFF = registerPlayer("hippogriff", Race.HIPPOGRIFF, PegasusModel::new, PonyArmourModel::new, (ctx, slim, dry) -> { + return new PlayerSeaponyRenderer(ctx, slim, getPlayerModel(Race.SEAPONY), dry); + }); public static final PlayerModelKey> EARTH_PONY = registerPlayer("earth_pony", Race.EARTH, EarthPonyModel::new); - public static final PlayerModelKey> SEA_PONY = registerPlayer("sea_pony", Race.SEAPONY, SeaponyModel::new, SeaponyModel.Armour::new, PlayerSeaponyRenderer::new); + public static final PlayerModelKey> SEA_PONY = registerPlayer("sea_pony", Race.SEAPONY, SeaponyModel::new, SeaponyModel.Armour::new, (ctx, slim, wet) -> { + return new PlayerSeaponyRenderer(ctx, slim, wet, getPlayerModel(Race.UNICORN)); + }); public static final PlayerModelKey> BAT_PONY = registerPlayer("bat_pony", Race.BATPONY, PegasusModel::new); public static final PlayerModelKey> CHANGELING = registerPlayer("changeling", Race.CHANGELING, ChangelingModel::new); public static final PlayerModelKey> CHANGEDLING = registerPlayer("reformed_changeling", Race.CHANGEDLING, ChangelingModel::new); diff --git a/src/main/java/com/minelittlepony/client/render/entity/PlayerSeaponyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/PlayerSeaponyRenderer.java index a25cfb76..a87951b9 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PlayerSeaponyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PlayerSeaponyRenderer.java @@ -17,15 +17,16 @@ import net.minecraft.util.Identifier; public class PlayerSeaponyRenderer extends PlayerPonyRenderer { public static final Identifier SKIN_TYPE_ID = new Identifier("minelp", "seapony"); - private final ModelWrapper> seapony; - private final ModelWrapper> normalPony; + private final ModelWrapper> wetPony; + private final ModelWrapper> dryPony; public PlayerSeaponyRenderer(EntityRendererFactory.Context context, boolean slim, - PlayerModelKey> key) { - super(context, slim, key); + PlayerModelKey> wetModel, + PlayerModelKey> dryModel) { + super(context, slim, wetModel); - normalPony = ModelType.getPlayerModel(Race.UNICORN).>create(slim); - seapony = getInternalRenderer().getModelWrapper(); + dryPony = dryModel.>create(slim); + wetPony = getInternalRenderer().getModelWrapper(); } @Override @@ -43,7 +44,7 @@ public class PlayerSeaponyRenderer extends PlayerPonyRenderer { (pony.race() == Race.SEAPONY || SkinsProxy.instance.getSkin(SKIN_TYPE_ID, player).isPresent()) && PonyPosture.isPartiallySubmerged(player); - model = manager.setModel(wet ? seapony : normalPony).body(); + model = manager.setModel(wet ? wetPony : dryPony).body(); float state = wet ? 100 : 0; float interpolated = pony.metadata().getInterpolator(player.getUuid()).interpolate("seapony_state", state, 5);