mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-30 07:37:31 +02:00
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:
parent
bf80d57abe
commit
39bb522051
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user