Skip to content

Commit

Permalink
HealthRender Element
Browse files Browse the repository at this point in the history
  • Loading branch information
opZywl authored Jan 19, 2024
1 parent 3e69815 commit 7b3c0f4
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* FDPClient Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge by LiquidBounce.
* https://github.com/SkidderMC/FDPClient/
*/
package net.ccbluex.liquidbounce.ui.client.hud.element.elements

import net.ccbluex.liquidbounce.ui.client.hud.element.Border
import net.ccbluex.liquidbounce.ui.client.hud.element.Element
import net.ccbluex.liquidbounce.ui.client.hud.element.ElementInfo
import net.ccbluex.liquidbounce.ui.client.hud.element.Side
import net.ccbluex.liquidbounce.utils.render.RoundedUtil
import java.awt.Color

@ElementInfo(name = "HealthRender")
class HealthRender(
x: Double = -8.0, y: Double = 57.0, scale: Float = 1F,
side: Side = Side(Side.Horizontal.MIDDLE, Side.Vertical.DOWN)
) : Element(x, y, scale, side) {

override fun drawElement(partialTicks: Float): Border {
val health = mc.thePlayer!!.health
val maxhealth = mc.thePlayer!!.maxHealth

RoundedUtil.drawRound(0f, 0f, 120f, 15f, 3F, Color(0, 0, 0, 80))

RoundedUtil.drawRound(0f, 0f, (health / maxhealth) * 120f, 15f, 3F, Color(4, 255, 88, 80))

return Border(0f, 0f, 120f, 15f, 0F)
}
}

0 comments on commit 7b3c0f4

Please sign in to comment.