mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Change rounding strategy to ceiling for mob healthbars
This commit is contained in:
parent
b08649d0a4
commit
71d030e5ad
@ -35,9 +35,9 @@ public final class MobHealthbarUtils {
|
|||||||
/**
|
/**
|
||||||
* Handle the creation of mob healthbars.
|
* Handle the creation of mob healthbars.
|
||||||
*
|
*
|
||||||
* @param profile The
|
* @param player the attacking player
|
||||||
* @param target
|
* @param target the targetted entity
|
||||||
* @param damage
|
* @param damage damage done by the attack triggering this
|
||||||
*/
|
*/
|
||||||
public static void handleMobHealthbars(Player player, LivingEntity target, int damage) {
|
public static void handleMobHealthbars(Player player, LivingEntity target, int damage) {
|
||||||
if (!Permissions.mobHealthDisplay(player)) {
|
if (!Permissions.mobHealthDisplay(player)) {
|
||||||
@ -132,7 +132,7 @@ public final class MobHealthbarUtils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int coloredDisplay = (int) (fullDisplay * (healthPercentage / 100.0D));
|
int coloredDisplay = (int) Math.ceil(fullDisplay * (healthPercentage / 100.0D));
|
||||||
int grayDisplay = fullDisplay - coloredDisplay;
|
int grayDisplay = fullDisplay - coloredDisplay;
|
||||||
|
|
||||||
String healthbar = color + "";
|
String healthbar = color + "";
|
||||||
|
Loading…
Reference in New Issue
Block a user