diff --git a/DynmapCore/src/main/resources/extracted/web/js/playermarkers.js b/DynmapCore/src/main/resources/extracted/web/js/playermarkers.js index 1f6fdb11..8f5a48b4 100644 --- a/DynmapCore/src/main/resources/extracted/web/js/playermarkers.js +++ b/DynmapCore/src/main/resources/extracted/web/js/playermarkers.js @@ -56,10 +56,10 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) { if (player.health !== undefined && player.armor !== undefined) { player.healthBar = $('
') .addClass('playerHealth') - .css('width', (player.health/2*5) + 'px'); + .css('width', Math.ceil(player.health*2.5) + 'px'); player.armorBar = $('') .addClass('playerArmor') - .css('width', (player.armor/2*5) + 'px'); + .css('width', Math.ceil(player.armor*2.5) + 'px'); $('') .addClass('playerHealthBackground') @@ -97,8 +97,8 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) { if (configuration.showplayerhealth) { if (player.health !== undefined && player.armor !== undefined) { player.healthContainer.css('display','block'); - player.healthBar.css('width', (player.health/2*5) + 'px'); - player.armorBar.css('width', (player.armor/2*5) + 'px'); + player.healthBar.css('width', Math.ceil(player.health*2.5) + 'px'); + player.armorBar.css('width', Math.ceil(player.armor*2.5) + 'px'); } else { player.healthContainer.css('display','none'); } diff --git a/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java b/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java index c21ac115..b9a81624 100644 --- a/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java +++ b/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java @@ -631,8 +631,9 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI { } @Override public double getHealth() { - if(player != null) - return helper.getHealth(player); + if(player != null) { + return Math.ceil(2.0 * player.getHealth() / player.getMaxHealth() * player.getHealthScale()) / 2.0; + } else return 0; }