Does not render Players at all if they're invisible (e.g. Spectator Mode) - resolving https://trello.com/c/Hy1NaAKu/
Does not render crosshair if hovering over invisible players
This commit is contained in:
@@ -11,6 +11,6 @@ public class SpectatingHandler {
|
|||||||
private static Minecraft mc = Minecraft.getMinecraft();
|
private static Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
public static boolean canSpectate(Entity e) {
|
public static boolean canSpectate(Entity e) {
|
||||||
return ((e instanceof EntityPlayer || e instanceof EntityLiving || e instanceof EntityItemFrame) && e != mc.thePlayer);
|
return ((e instanceof EntityPlayer || e instanceof EntityLiving || e instanceof EntityItemFrame) && e != mc.thePlayer && !e.isInvisible());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class InvisibilityRender extends RenderPlayer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldRender(Entity entity, ICamera camera, double camX, double camY, double camZ) {
|
public boolean shouldRender(Entity entity, ICamera camera, double camX, double camY, double camZ) {
|
||||||
if(PlayerHandler.isHidden(entity.getUniqueID()) ||
|
if(PlayerHandler.isHidden(entity.getUniqueID()) || entity.isInvisible() ||
|
||||||
(ReplayHandler.isInReplay() && entity == Minecraft.getMinecraft().thePlayer)) return false;
|
(ReplayHandler.isInReplay() && entity == Minecraft.getMinecraft().thePlayer)) return false;
|
||||||
return super.shouldRender(entity, camera, camX, camY, camZ);
|
return super.shouldRender(entity, camera, camX, camY, camZ);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user