Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static String value;
- private static String hearts(float health) {
- char h = 10084;
- if (health >= 0.1F && health <= 2.0F) {
- return value = "" + h;
- } else if (health >= 2.1F && health <= 4.0F) {
- return value = "" + h+h;
- } else if (health >= 3.1F && health <= 6.0F) {
- return value = "" + h+h+h;
- } else if (health >= 6.1F && health <= 8.0F) {
- return value = "" + h+h+h+h;
- } else if (health >= 8.1F && health <= 10.0F) {
- return value = "" + h+h+h+h+h;
- } else if (health >= 10.1F && health <= 12.0F) {
- return value = "" + h+h+h+h+h+h;
- } else if (health >= 12.1F && health <= 14.0F) {
- return value = "" + h+h+h+h+h+h+h;
- } else if (health >= 14.1F && health <= 16.0F) {
- return value = "" + h+h+h+h+h+h+h+h;
- } else if (health >= 16.1F && health <= 18.0F) {
- return value = "" + h+h+h+h+h+h+h+h+h;
- } else if (health >= 18.1F && health <= 20.0F) {
- return value = "" + h+h+h+h+h+h+h+h+h+h;
- } else if (health == 0.0F) {
- return "";
- }
- return value;
- }
- public static String setDynamicHearts(float maxHealth, float lostHealth) {
- if (maxHealth == 2.0F) {
- return GRAY + "(" + RED + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 4.0F) {
- return GRAY + "(" + BLUE + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 6.0F) {
- return GRAY + "(" + DARK_GREEN + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 8.0F) {
- return GRAY + "(" + GOLD + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 10.0F) {
- return GRAY + "(" + LIGHT_PURPLE + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 12.0F) {
- return GRAY + "(" + DARK_PURPLE + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 14.0F) {
- return GRAY + "(" + YELLOW + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 16.0F) {
- return GRAY + "(" + DARK_AQUA + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 18.0F) {
- return GRAY + "(" + GREEN + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else if (maxHealth == 20.0F) {
- return GRAY + "(" + BLACK + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- } else {
- return GRAY + "(" + RED + "" + hearts(maxHealth) + DARK_GRAY + "" + hearts(lostHealth - 1) + GRAY + ")";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement