diff --git a/v1.12.2/src/main/java/top/fpsmaster/forge/mixin/MixinRender.java b/v1.12.2/src/main/java/top/fpsmaster/forge/mixin/MixinRender.java index f62cd1a..0082456 100644 --- a/v1.12.2/src/main/java/top/fpsmaster/forge/mixin/MixinRender.java +++ b/v1.12.2/src/main/java/top/fpsmaster/forge/mixin/MixinRender.java @@ -17,6 +17,8 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import top.fpsmaster.FPSMaster; +import top.fpsmaster.features.impl.utility.LevelTag; +import top.fpsmaster.interfaces.ProviderManager; import top.fpsmaster.modules.client.PlayerManager; import top.fpsmaster.features.impl.optimizes.CheckEntity; import top.fpsmaster.features.impl.optimizes.Performance; @@ -57,6 +59,38 @@ public void preRender(Entity entity, double x, double y, double z, float entityY } } + @Inject(method = "renderLivingLabel", at = @At("HEAD"), cancellable = true) + protected void renderLivingLabel(Entity entityIn, String str, double x, double y, double z, int maxDistance, CallbackInfo ci) { + if (LevelTag.health.getValue()) { + double d = entityIn.getDistanceSq(this.renderManager.renderViewEntity); + if (d < 100) { + float f = 1.6F; + float g = 0.016666668F * f; + GlStateManager.pushMatrix(); + GlStateManager.translate((float) x + 0.0F, (float) y + entityIn.height + 0.5F, (float) z); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(-g, -g, g); + GlStateManager.disableLighting(); + GlStateManager.depthMask(false); + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + ProviderManager.guiIngameProvider.drawHealth(entityIn); + GlStateManager.disableTexture2D(); + GlStateManager.enableTexture2D(); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + } else { + ci.cancel(); + } + } + + @Inject(method = "renderName",at = @At("HEAD"), cancellable = true) public void ignore(Entity entity, double x, double y, double z, CallbackInfo ci){ if (Performance.using && Performance.ignoreStands.getValue() && entity instanceof EntityArmorStand) { diff --git a/v1.8.9/src/main/java/top/fpsmaster/forge/mixin/MixinRender.java b/v1.8.9/src/main/java/top/fpsmaster/forge/mixin/MixinRender.java index 1009a57..afd3178 100644 --- a/v1.8.9/src/main/java/top/fpsmaster/forge/mixin/MixinRender.java +++ b/v1.8.9/src/main/java/top/fpsmaster/forge/mixin/MixinRender.java @@ -40,7 +40,7 @@ public void doRender(Entity entity, double x, double y, double z, float entityYa protected void renderLivingLabel(Entity entityIn, String str, double x, double y, double z, int maxDistance, CallbackInfo ci) { if (LevelTag.health.getValue()) { double d = entityIn.getDistanceSqToEntity(this.renderManager.livingPlayer); - if (d < 20) { + if (d < 100) { float f = 1.6F; float g = 0.016666668F * f; GlStateManager.pushMatrix();