-
Notifications
You must be signed in to change notification settings - Fork 1
/
ModHealthIndicator.java
38 lines (27 loc) · 1.03 KB
/
ModHealthIndicator.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package shaderclient.mods.impl;
import net.minecraft.entity.EntityLiving;
import shaderclient.gui.hud.ScreenPosition;
import shaderclient.mods.ModDraggable;
public class ModHealthIndicator extends ModDraggable {
@Override
public int getWidth() {
return font.getStringWidth("HP: 20");
}
@Override
public int getHeight() {
return font.FONT_HEIGHT;
}
@Override
public void render(ScreenPosition pos) {
if (this.mc.pointedEntity != null) {
if (this.mc.pointedEntity instanceof EntityLiving) {
EntityLiving entityRaytraced = (EntityLiving) this.mc.pointedEntity;
font.drawString("HP: " + (int) entityRaytraced.getHealth(), pos.getAbsoluteX() + 1, pos.getAbsoluteY() + 1, -1);
}
}
}
@Override
public void renderDummy(ScreenPosition pos) {
font.drawString("HP: 20", pos.getAbsoluteX() + 1, pos.getAbsoluteY() + 1, 0xFF00FF00);
}
}