Skip to content

Commit

Permalink
Fix LODs
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Nov 4, 2024
1 parent 8c153a3 commit 626c1b4
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/main/java/dev/tr7zw/skinlayers/mixin/PlayerRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 626c1b4

Please sign in to comment.