Fixed custom entity model partially visible render

This commit is contained in:
Goodbird committed 2024-03-09 22:52:19 +03:00
1 parent f434585aec
commit 44ed3b3991
3 files changed
+24 -12

No files matched your search

@@ -123,21 +123,29 @@ public class MixinGeckoAddonClient {
(mainModel).entity.renderYawOffset = (mainModel).entity.prevRenderYawOffset = 0;
if (!npc.isInvisible())
{
RenderManager.instance.renderEntityWithPosYaw(((ModelMPM) mainModel).entity, 0,0,0,rot,partial);
if(mainModel.entity instanceof EntityCustomModel){
((EntityCustomModel)mainModel.entity).isSemiVisible = false;
}
RenderManager.instance.renderEntityWithPosYaw(mainModel.entity, 0,0,0,rot,partial);
}
else if (!npc.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer))
{
GL11.glPushMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
RenderManager.instance.renderEntityWithPosYaw(((ModelMPM) mainModel).entity, 0,0,0,rot,partial);
GL11.glDisable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glPopMatrix();
GL11.glDepthMask(true);
if(mainModel.entity instanceof EntityCustomModel){
((EntityCustomModel)mainModel.entity).isSemiVisible = true;
RenderManager.instance.renderEntityWithPosYaw(mainModel.entity, 0,0,0,rot,partial);
}else {
GL11.glPushMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
RenderManager.instance.renderEntityWithPosYaw(mainModel.entity, 0, 0, 0, rot, partial);
GL11.glDisable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glPopMatrix();
GL11.glDepthMask(true);
}
}
}
}