Skip to content

Commit

Permalink
Fix visual scaling and fix crash when enabling the MineLP integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Jul 22, 2024
1 parent ac105db commit 0c2a677
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ public void onInitializeClient() {
INSTANCE = this;

PonyModelPrepareCallback.EVENT.register((entity, model, mode) -> {
if (BigPony.getInstance().getConfig().useDetectedPonyScaling.get() && isPony((PlayerEntity)entity)) {
if (BigPony.getInstance().getConfig().useDetectedPonyScaling.get()
&& entity instanceof PlayerEntity player
&& BigPonyClient.isClientPlayer(player)
&& isPony(player)) {
model.getAttributes().visualHeight = entity.getHeight() / model.getSize().scaleFactor();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@

@Mixin(LivingEntityRenderer.class)
abstract class MixinLivingEntityRenderer<T extends LivingEntity, M extends EntityModel<T>> {


@ModifyVariable(method = "Lnet/minecraft/client/render/entity/LivingEntityRenderer;setupTransforms("
+ "Lnet/minecraft/entity/LivingEntity;"
+ "Lnet/minecraft/client/util/math/MatrixStack;"
+ "FFF"
+ ")V",
at = @At("HEAD"),
ordinal = 3
@ModifyVariable(
method = "setupTransforms",
at = @At("HEAD"),
ordinal = 3,
argsOnly = true
)
private float modifyScaleonSetupTransforms(float initial, T entity, MatrixStack matrices) {
private float modifyScaleOnSetupTransforms(float initial, T entity, MatrixStack matrices, float animationProgress, float bodyYaw, float tickDelta, float vanillaScale) {
if (entity instanceof Scaling.Holder holder) {
BodyScale scale = holder.getScaling().getRenderedBodyScale();
matrices.scale(scale.x(), scale.y(), scale.z());
Expand Down

0 comments on commit 0c2a677

Please sign in to comment.