Use the correct texture in first person mode. Closes #238

This commit is contained in:
Sollace 2023-07-09 16:15:59 +01:00
parent ee536cfe6a
commit b38c8530f8
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -8,6 +8,7 @@ import com.minelittlepony.client.model.*;
import com.minelittlepony.client.render.DebugBoundingBoxRenderer; import com.minelittlepony.client.render.DebugBoundingBoxRenderer;
import com.minelittlepony.client.render.IPonyRenderContext; import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.client.render.entity.feature.*; import com.minelittlepony.client.render.entity.feature.*;
import com.minelittlepony.client.util.render.RenderLayerUtil;
import com.minelittlepony.client.render.EquineRenderManager; import com.minelittlepony.client.render.EquineRenderManager;
import java.util.List; import java.util.List;
@ -142,11 +143,14 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen
stack.translate(reflect * 0.1F, -0.54F, 0); stack.translate(reflect * 0.1F, -0.54F, 0);
Identifier texture = getTexture(player);
Identifier playerSkin = player.getSkinTexture();
VertexConsumerProvider interceptedContext = layer -> { VertexConsumerProvider interceptedContext = layer -> {
return renderContext.getBuffer( return renderContext.getBuffer(RenderLayerUtil
layer == RenderLayer.getEntitySolid(player.getSkinTexture()) .getTexture(layer)
? RenderLayer.getEntityTranslucent(player.getSkinTexture()) .filter(playerSkin::equals)
: layer .map(i -> RenderLayer.getEntityTranslucent(texture))
.orElse(layer)
); );
}; };