mirror of
https://github.com/zeshan321/ActionHealth.git
synced 2025-03-10 13:49:07 +01:00
Display half health icon more accurately
This commit is contained in:
parent
ce78bbc078
commit
b45e1a7ec3
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: ActionHealth
|
||||
main: com.zeshanaslam.actionhealth.Main
|
||||
version: 3.1.2
|
||||
version: 3.1.3
|
||||
commands:
|
||||
Actionhealth:
|
||||
description: Actionhealth main command.
|
@ -57,6 +57,7 @@ public class HealthUtil {
|
||||
String style = "";
|
||||
int left = 10;
|
||||
int heart = maxHealth / 10;
|
||||
int halfHeart = heart / 2;
|
||||
int tempHealth = health;
|
||||
|
||||
if (maxHealth != health && health >= 0 && !entity.isDead()) {
|
||||
@ -69,9 +70,14 @@ public class HealthUtil {
|
||||
}
|
||||
}
|
||||
|
||||
if (tempHealth > 0) {
|
||||
style = style + plugin.settingsManager.halfHeartIcon;
|
||||
if (tempHealth > halfHeart) {
|
||||
style = style + plugin.settingsManager.filledHeartIcon;
|
||||
left--;
|
||||
} else {
|
||||
if (tempHealth > 0 && tempHealth <= halfHeart) {
|
||||
style = style + plugin.settingsManager.halfHeartIcon;
|
||||
left--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user