From 626c1b4b20177f94aca083181a5ec5f93da58298 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Mon, 4 Nov 2024 19:18:40 +0100 Subject: [PATCH] Fix LODs --- .../skinlayers/mixin/PlayerRendererMixin.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/dev/tr7zw/skinlayers/mixin/PlayerRendererMixin.java b/src/main/java/dev/tr7zw/skinlayers/mixin/PlayerRendererMixin.java index f4e458a..0efb360 100644 --- a/src/main/java/dev/tr7zw/skinlayers/mixin/PlayerRendererMixin.java +++ b/src/main/java/dev/tr7zw/skinlayers/mixin/PlayerRendererMixin.java @@ -73,12 +73,6 @@ public PlayerRendererMixin(Context context, PlayerModel entityModel, float f) { public void extractRenderState(AbstractClientPlayer abstractClientPlayer, PlayerRenderState playerRenderState, float f, CallbackInfo ci) { PlayerModel playerModel = this.getModel(); - if (Minecraft.getInstance().player == null - || abstractClientPlayer.distanceToSqr(Minecraft.getInstance().gameRenderer.getMainCamera() - .getPosition()) > SkinLayersModBase.config.renderDistanceLOD - * SkinLayersModBase.config.renderDistanceLOD) { - return; - } PlayerSettings settings = (PlayerSettings) abstractClientPlayer; boolean slim = ((PlayerEntityModelAccessor) getModel()).hasThinArms(); // reset all injected layers @@ -88,6 +82,12 @@ public void extractRenderState(AbstractClientPlayer abstractClientPlayer, Player ((ModelPartInjector) (Object) playerModel.rightSleeve).setInjectedMesh(null, null); ((ModelPartInjector) (Object) playerModel.leftPants).setInjectedMesh(null, null); ((ModelPartInjector) (Object) playerModel.rightPants).setInjectedMesh(null, null); + if (Minecraft.getInstance().player == null + || abstractClientPlayer.distanceToSqr(Minecraft.getInstance().gameRenderer.getMainCamera() + .getPosition()) > SkinLayersModBase.config.renderDistanceLOD + * SkinLayersModBase.config.renderDistanceLOD) { + return; + } if (!SkinUtil.setup3dLayers(abstractClientPlayer, settings, slim)) { // fall back to vanilla return; @@ -127,16 +127,10 @@ public void extractRenderState(AbstractClientPlayer abstractClientPlayer, Player //$$ public void setModelProperties(AbstractClientPlayer abstractClientPlayer, CallbackInfo info) { //$$ PlayerModel playerModel = this.getModel(); //$$ if (!loaded) { - //$$ this.addLayer(new dev.tr7zw.skinlayers.renderlayers.CustomLayerFeatureRenderer(this)); + //$$ this.addLayer(new dev.tr7zw.skinlayers.renderlayers.CustomLayerFeatureRenderer(this)); //$$ //$$ loaded = true; //$$ } - //$$ if (Minecraft.getInstance().player == null - //$$ || abstractClientPlayer.distanceToSqr(Minecraft.getInstance().gameRenderer.getMainCamera() - //$$ .getPosition()) > SkinLayersModBase.config.renderDistanceLOD - //$$ * SkinLayersModBase.config.renderDistanceLOD) { - //$$ return; - //$$ } //$$ PlayerSettings settings = (PlayerSettings) abstractClientPlayer; //$$ boolean slim = ((PlayerEntityModelAccessor) getModel()).hasThinArms(); //$$ // reset all injected layers @@ -146,6 +140,12 @@ public void extractRenderState(AbstractClientPlayer abstractClientPlayer, Player //$$ ((ModelPartInjector) (Object) playerModel.rightSleeve).setInjectedMesh(null, null); //$$ ((ModelPartInjector) (Object) playerModel.leftPants).setInjectedMesh(null, null); //$$ ((ModelPartInjector) (Object) playerModel.rightPants).setInjectedMesh(null, null); + //$$ if (Minecraft.getInstance().player == null + //$$ || abstractClientPlayer.distanceToSqr(Minecraft.getInstance().gameRenderer.getMainCamera() + //$$ .getPosition()) > SkinLayersModBase.config.renderDistanceLOD + //$$ * SkinLayersModBase.config.renderDistanceLOD) { + //$$ return; + //$$ } //$$ if (!SkinUtil.setup3dLayers(abstractClientPlayer, settings, slim)) { //$$ // fall back to vanilla //$$ return;