diff --git a/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java b/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java index d656e318..2f9631e5 100644 --- a/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java +++ b/src/main/java/com/minelittlepony/client/model/entity/race/SeaponyModel.java @@ -3,12 +3,10 @@ package com.minelittlepony.client.model.entity.race; import com.minelittlepony.client.model.armour.PonyArmourModel; import com.minelittlepony.mson.api.ModelView; import com.minelittlepony.api.model.*; -import com.minelittlepony.api.model.armour.ArmourLayer; import com.minelittlepony.api.pony.IPony; import net.minecraft.client.model.ModelPart; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; import net.minecraft.util.math.MathHelper; @@ -25,6 +23,15 @@ public class SeaponyModel extends UnicornModel { leftFin = tree.getChild("left_fin"); rightFin = tree.getChild("right_fin"); centerFin = tree.getChild("center_fin"); + + jacket.hidden = true; + + leftPants.hidden = true; + rightPants.hidden = true; + leftSleeve.hidden = true; + rightSleeve.hidden = true; + leftLeg.hidden = true; + rightLeg.hidden = true; } public SeaponyModel(ModelPart tree) { @@ -112,17 +119,6 @@ public class SeaponyModel extends UnicornModel { @Override public void setVisible(boolean visible) { super.setVisible(visible); - - leftSleeve.visible = false; - rightSleeve.visible = false; - jacket.visible = false; - - // hide the back legs - leftLeg.visible = false; - rightLeg.visible = false; - leftPants.visible = false; - rightPants.visible = false; - leftFin.visible = visible; centerFin.visible = visible; rightFin.visible = visible; @@ -132,14 +128,8 @@ public class SeaponyModel extends UnicornModel { public Armour(ModelPart tree) { super(tree); - } - - @Override - public boolean setVisibilities(EquipmentSlot slot, ArmourLayer layer) { - boolean result = super.setVisibilities(slot, layer); - rightLeg.visible = false; - leftLeg.visible = false; - return result; + rightLeg.hidden = true; + leftLeg.hidden = true; } @Override 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 d70219c0..a25cfb76 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PlayerSeaponyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PlayerSeaponyRenderer.java @@ -8,7 +8,9 @@ import com.minelittlepony.client.model.*; import com.minelittlepony.util.MathUtil; import net.minecraft.client.network.AbstractClientPlayerEntity; +import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.entity.EntityRendererFactory; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.particle.ParticleTypes; import net.minecraft.util.Identifier; @@ -28,14 +30,18 @@ public class PlayerSeaponyRenderer extends PlayerPonyRenderer { @Override public Identifier getTexture(AbstractClientPlayerEntity player) { - return SkinsProxy.instance.getSkin(SKIN_TYPE_ID, player).orElseGet(() -> super.getTexture(player)); + if (PonyPosture.isPartiallySubmerged(player)) { + return SkinsProxy.instance.getSkin(SKIN_TYPE_ID, player).orElseGet(() -> super.getTexture(player)); + } + return super.getTexture(player); } @Override - public IPony getEntityPony(AbstractClientPlayerEntity player) { - IPony pony = super.getEntityPony(player); - - boolean wet = PonyPosture.isPartiallySubmerged(player); + public void render(AbstractClientPlayerEntity player, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int light) { + IPony pony = getEntityPony(player); + boolean wet = + (pony.race() == Race.SEAPONY || SkinsProxy.instance.getSkin(SKIN_TYPE_ID, player).isPresent()) + && PonyPosture.isPartiallySubmerged(player); model = manager.setModel(wet ? seapony : normalPony).body(); @@ -50,6 +56,6 @@ public class PlayerSeaponyRenderer extends PlayerPonyRenderer { player.getEntityWorld().addParticle(ParticleTypes.END_ROD, x, y, z, 0, 0, 0); } - return pony; + super.render(player, entityYaw, tickDelta, stack, renderContext, light); } } diff --git a/src/main/resources/assets/minelittlepony/models/entity/races/steve/sea_pony.json b/src/main/resources/assets/minelittlepony/models/entity/races/steve/sea_pony.json index 997f699d..c5e6a4a9 100644 --- a/src/main/resources/assets/minelittlepony/models/entity/races/steve/sea_pony.json +++ b/src/main/resources/assets/minelittlepony/models/entity/races/steve/sea_pony.json @@ -37,6 +37,13 @@ "tail_stub": {} } }, + "jacket": { + "texture": { "u": 24, "v": 0 }, + "dilate": 0.25, + "cubes": [ + { "from": [-4, 4, -2], "size": [ 8, 8, 4 ], "texture": { "u": 16, "v": 32 }, "dilate": 0.25 } + ] + }, "tail": { "implementation": "com.minelittlepony.client.model.part.SeaponyTail", "data": "minelittlepony:components/fish_tail"