Entities using GeoEntityRenderer still render when being invisible
mcpecommander opened this issue ยท 1 comments
Invisibility potions don't affect mobs or entities extending GeoEntityRenderer.
The reason is because mobs by default have renderType entityCutout which ignores the alpha value in the renderRecursively method.
An easier solution to this, is to simply move the check to the shouldRender method or do the boolean check for the whole render call:
if(entity.isInvisibleTo(Minecraft.getInstance().player)) render(model, entity, partialTicks, renderType, stack, bufferIn, null, packedLightIn,
getPackedOverlay(entity, 0), (float) renderColor.getRed() / 255f, (float) renderColor.getGreen() / 255f,
(float) renderColor.getBlue() / 255f, invis ? 0.0F : (float) renderColor.getAlpha() / 255);
You might as well use the method isVisible that is sitting there not doing anything.
This line:
instead of rewriting entity.isInvisibleTo.