ща
@EventTarget
public void onRender2D(EventRender2D event) {
if (!TargetHud.mc.gameSettings.showDebugInfo) {
if (KillAura.targetEntity != null) {
this.currentTarget = KillAura.targetEntity;
} else if (TargetHud.mc.currentScreen instanceof GuiChat) {
this.currentTarget = TargetHud.mc.player;
}
if (this.currentTarget != null) {
if (KillAura.targetEntity == null && !(TargetHud.mc.currentScreen instanceof GuiChat)) {
this.animation.setDirection(Direction.BACKWARDS);
} else {
this.animation.setDirection(Direction.FORWARDS);
}
RenderUtility.scaleStart(this.targetHudDraggable.getX() + 56, this.targetHudDraggable.getY() + 19, this.animation.getOutput());
RenderUtility.drawRoundedRect((float)this.targetHudDraggable.getX() - 8.0f, (float)this.targetHudDraggable.getY() - 6.5f, 145.0f, 56.0f, 0.0f, new Color(0, 0, 0, 255).getRGB());
RenderUtility.drawRoundedRect((float)this.targetHudDraggable.getX() - 7.3f, (float)this.targetHudDraggable.getY() - 6.0f, 143.8f, 55.0f, 0.0f, new Color(44, 44, 44, 255).getRGB());
RenderUtility.drawRoundedRect(this.targetHudDraggable.getX() - 3, this.targetHudDraggable.getY() - 2, 135.0f, 47.0f, 0.0f, new Color(22, 22, 22, 255).getRGB());
RenderUtility.drawRoundedRect(this.targetHudDraggable.getX() + 1, (float)this.targetHudDraggable.getY() + 3.0f, 37.0f, 37.5f, 0.0f, new Color(44, 44, 44, 255).getRGB());
RenderUtility.drawRoundedRect(this.targetHudDraggable.getX() + 2, (float)this.targetHudDraggable.getY() + 4.0f, 35.0f, 35.5f, 0.0f, new Color(28, 28, 28, 255).getRGB());
if (this.currentTarget instanceof EntityPlayer) {
StencilUtility.initStencilToWrite();
float hurtPercent = TargetHud.getHurtPercent(this.currentTarget);
GlStateManager.enableColorMaterial();
GlStateManager.color(1.0f, 1.0f - hurtPercent, 1.0f - hurtPercent, 1.0f);
StencilUtility.uninitStencilBuffer();
}
StencilUtility.initStencilToWrite();
RenderUtility.drawRoundedRect(this.targetHudDraggable.getX(), this.targetHudDraggable.getY(), 112.0f, 38.0f, 5.0f, new Color(30, 30, 30).getRGB());
StencilUtility.readStencilBuffer(1);
Fonts.tenacityBold16.drawSubstring(TextFormatting.getTextWithoutFormattingCodes(this.currentTarget.getName()), this.targetHudDraggable.getX() + 41, this.targetHudDraggable.getY() + 6, Color.WHITE.getRGB(), 65.0f);
StencilUtility.uninitStencilBuffer();
int itemOffset = 36;
if (this.wle.get()) {
if (this.currentTarget.getHealth() >= TargetHud.mc.player.getHealth()) {
Fonts.nunitoBold22.drawString("[Loosing]", this.targetHudDraggable.getX() + 40, this.targetHudDraggable.getY() + 55, Color.white.getRGB());
} else if (this.currentTarget.getHealth() <= 2.0f) {
Fonts.nunitoBold22.drawString("[EZZ!]", this.targetHudDraggable.getX() + 52, this.targetHudDraggable.getY() + 55, Color.white.getRGB());
} else if (this.currentTarget.getHealth() <= TargetHud.mc.player.getHealth()) {
Fonts.nunitoBold22.drawString("[Winning]", this.targetHudDraggable.getX() + 40, this.targetHudDraggable.getY() + 55, Color.white.getRGB());
}
}
for (ItemStack itemStack : this.currentTarget.getEquipmentAndArmor()) {
if (!itemStack.isEmpty()) {
GlStateManager.pushMatrix();
GlStateManager.translate(this.targetHudDraggable.getX() + itemOffset + 79, this.targetHudDraggable.getY() + 29, 0.0f);
GlStateManager.scale(0.9, 0.9, 4.5);
RenderUtility.drawItemStack(itemStack, 0, 0);
GlStateManager.popMatrix();
}
itemOffset -= 15;
}
this.hp = MathUtility.clamp(MathUtility.lerp(this.hp, this.currentTarget.getHealth() / this.currentTarget.getMaxHealth(), (float)(30.0 * AnimationMath.deltaTime())), 0.0f, 1.0f);
Color health1 = Color.GREEN;
if (this.currentTarget.getHealth() >= 10.0f) {
health1 = Color.GREEN;
} else if (this.currentTarget.getHealth() >= 5.0f && this.currentTarget.getHealth() <= 9.0f) {
health1 = Color.YELLOW;
} else if (this.currentTarget.getHealth() > 0.0f && this.currentTarget.getHealth() <= 5.0f) {
health1 = Color.RED;
} else if (this.currentTarget != null && this.currentTarget.getHealth() <= 0.0f) {
health1 = Color.RED;
}
RenderUtility.drawEntityOnScreen(this.targetHudDraggable.getX() + 19, this.targetHudDraggable.getY() + 38, 17, this.currentTarget);
RenderUtility.drawRoundedRect((float)this.targetHudDraggable.getX() + 41.5f, (float)this.targetHudDraggable.getY() + 15.0f, 75.0f, 5.0f, 0.0f, new Color(0, 0, 0, 255).getRGB());
RenderUtility.drawRect(this.targetHudDraggable.getX() + 42, (float)this.targetHudDraggable.getY() + 15.5f, 74.0f, 3.9f, Color.black.getRGB());
RenderUtility.drawRect(this.targetHudDraggable.getX() + 42, (float)this.targetHudDraggable.getY() + 15.5f, 74.0f * this.hp, 3.9f, health1.getRGB());
Fonts.tenacityBold12.drawCenteredString(" | | | | | | | | | ", (float)this.targetHudDraggable.getX() + 75.0f, (float)this.targetHudDraggable.getY() + 16.5f, Color.BLACK.getRGB());
RenderUtility.drawRoundedRect(this.targetHudDraggable.getX() + 38, this.targetHudDraggable.getY() + 20, 80.0f, 2.0f, 0.0f, new Color(22, 22, 22, 255).getRGB());
RenderUtility.drawRoundedRect(this.targetHudDraggable.getX() + 38, this.targetHudDraggable.getY() + 13, 80.0f, 2.0f, 0.0f, new Color(22, 22, 22, 255).getRGB());
if (this.glow.get()) {
RenderUtility.drawGlow(this.targetHudDraggable.getX() + 41, this.targetHudDraggable.getY() + 15, 76.0f * this.hp, 5.0f, this.glowRadius.getInt(), health1);
}
FontRenderer render = Fonts.tenacityBold16;
int var10001 = (int)MathUtility.round(this.hp * 20.0f + this.currentTarget.getAbsorptionAmount(), 0.5);
render.drawString("HP:" + var10001 + " | Dist:" + (int)TargetHud.mc.player.getDistance(this.currentTarget), this.targetHudDraggable.getX() + 42, (float)this.targetHudDraggable.getY() + 22.5f, Color.WHITE.getRGB());
RenderUtility.scaleEnd();
}
}
}