Fix capes

This commit is contained in:
Sollace 2024-12-14 00:47:38 +01:00
parent 7fce6c94a3
commit 2e7442b07a
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
7 changed files with 19 additions and 8 deletions

View file

@ -47,6 +47,8 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modApi "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "com.ptsmods:devlogin:3.4.1"
modApi fabricApi.module("fabric-api-base", project.fabric_version)
modApi fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version)
modApi fabricApi.module("fabric-resource-loader-v0", project.fabric_version)

View file

@ -20,6 +20,6 @@ org.gradle.daemon=false
# Dependencies
modmenu_version=12.0.0-beta.1
kirin_version=1.20.2+1.21.3
kirin_version=1.20.3+1.21.3
hd_skins_version=6.14.1+1.21.3
mson_version=1.11.1+1.21.3

View file

@ -67,10 +67,12 @@ public class MineLPHDSkins extends ClientSkinsProxy implements ClientModInitiali
if (hdPony.isPresent() && vanillaPony.isPresent()
&& vanillaPony.get().metadata().priority() > hdPony.get().metadata().priority()
&& (PonyConfig.getInstance().ponyLevel.get() == PonyLevel.HUMANS || vanillaPony.get().metadata().race().isHuman() == hdPony.get().metadata().race().isHuman())) {
&& (PonyConfig.getInstance().ponyLevel.get() == PonyLevel.HUMANS
|| vanillaPony.get().metadata().race().isHuman() == hdPony.get().metadata().race().isHuman())) {
return playerSkins.vanilla();
}
}
return playerSkins.combined();
});
}

View file

@ -87,9 +87,6 @@ public class PlayerPonyRenderer
public void updateRenderState(AbstractClientPlayerEntity entity, PlayerEntityRenderState state, float tickDelta) {
super.updateRenderState(entity, state, tickDelta);
manager.updateState(entity, (PlayerPonyRenderState)state, mode);
// Rotate cape to align with the pony back
//state.field_53536 += MathHelper.PI / 4;
}
public final PlayerPonyRenderState getAndUpdateRenderState(AbstractClientPlayerEntity entity, float tickDelta, ModelAttributes.Mode mode) {

View file

@ -17,6 +17,7 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.equipment.EquipmentModel;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.RotationAxis;
public class CapeFeature extends CapeFeatureRenderer {
@ -35,6 +36,7 @@ public class CapeFeature extends CapeFeatureRenderer {
ArmourRendererPlugin plugin = ArmourRendererPlugin.INSTANCE.get();
Identifier capeTexture = player.skinTextures.capeTexture();
if (capeTexture == null) {
return;
}
@ -49,12 +51,16 @@ public class CapeFeature extends CapeFeatureRenderer {
if (RenderLayerUtil.getTexture(layer).orElse(null) == capeTexture) {
rendered[0] = true;
matrices.translate(0, 0.24F, 0);
matrices.translate(0, 0.34F, 0);
if (((PlayerPonyRenderState)player).getAttributes().isLyingDown) {
matrices.translate(0, -0.05F, 0);
}
model.transform((PlayerPonyRenderState)player, BodyPart.BODY, matrices);
model.getBodyPart(BodyPart.BODY).rotate(matrices);
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(85));
if (player.baby) {
matrices.scale(1.1F, 1.1F, 1.1F);
}
return buffer;
}

View file

@ -27,8 +27,6 @@ public class ElytraFeature<
S extends PonyRenderState,
M extends ClientPonyModel<S>
> extends FeatureRenderer<S, M> {
private static final Identifier TEXTURE = Identifier.ofVanilla("textures/entity/elytra.png");
private final PonyElytra<S> model = ModelType.ELYTRA.createModel();
private final FeatureRendererContext<S, M> context;

View file

@ -58,6 +58,12 @@ public class PonyRenderState extends PlayerEntityRenderState implements PonyMode
) && entity.hasCustomName() && entity.getCustomName().getString().equalsIgnoreCase("technoblade")
);
// Adjust cape angles
// capePitch
field_53537 *= 0.3F;
// capeRoll
field_53538 *= 3F;
PonyPosture.of(attributes).updateState(entity, this);
PonyModelPrepareCallback.EVENT.invoker().onPonyModelPrepared(attributes, model, ModelAttributes.Mode.OTHER);
}