Added an extra death check to health regen.

This commit is contained in:
Aria 2019-10-15 12:06:00 +02:00
parent d24e29705c
commit 11dcf97f9a

View File

@ -382,7 +382,8 @@ public class PlayerData {
}
public void heal(double heal) {
getPlayer().setHealth(Math.min(player.getHealth() + heal, player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()));
double healAmount = Math.min(player.getHealth() + heal, player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());
if(healAmount > 0) getPlayer().setHealth(healAmount);
}
public void addFriend(UUID uuid) {