Don't render an Entity's nametag if it's invisible and the renderInvisible setting is set to false

This commit is contained in:
CrushedPixel
2015-09-04 17:32:58 +02:00
parent 409c215937
commit e0785b4f25

View File

@@ -19,8 +19,12 @@ public abstract class MixinRendererLivingEntity {
private void areAllNamesHidden(EntityLivingBase entity, CallbackInfoReturnable<Boolean> ci) { private void areAllNamesHidden(EntityLivingBase entity, CallbackInfoReturnable<Boolean> ci) {
EntityRendererHandler handler = ((EntityRendererHandler.IEntityRenderer) Minecraft.getMinecraft().entityRenderer).getHandler(); EntityRendererHandler handler = ((EntityRendererHandler.IEntityRenderer) Minecraft.getMinecraft().entityRenderer).getHandler();
if (handler != null && handler.getOptions().isHideNameTags()) { if (handler != null && handler.getOptions().isHideNameTags()) {
ci.setReturnValue(false); //this calls the cancel method
}
if(ReplayHandler.isInReplay() && entity.isInvisible()
&& ReplaySettings.ReplayOptions.renderInvisible.getValue() == Boolean.FALSE) {
ci.setReturnValue(false); ci.setReturnValue(false);
ci.cancel();
} }
} }