Fixes heal flag bugs when player.maxHealth > 20

With the new Bukkit Changes the Player Health can be above 20, this fixes the magic number by using the now built in Bukkit functionality.

Examples of this bug were Health jumping to 1/20 hearts when having a heal-amount: -1
This commit is contained in:
Silthus 2013-05-04 11:47:43 +03:00
parent bf80d57abe
commit 39bb522051

View File

@ -119,7 +119,7 @@ private void processHeal(ApplicableRegionSet applicable, Player player,
return;
}
if (minHealth == null) minHealth = 0;
if (maxHealth == null) maxHealth = 20;
if (maxHealth == null) maxHealth = player.getMaxHealth();
// Apply a cap to prevent possible exceptions
minHealth = Math.min(player.getMaxHealth(), minHealth);