1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-06 14:46:32 +02:00

Update heal to account for the fact that 20 is not always the max health

This commit is contained in:
Iaccidentally
2013-01-26 17:12:17 -05:00
parent 60c524b3bc
commit 7ccf9c25ac

View File

@@ -68,14 +68,14 @@ public class Commandheal extends EssentialsCommand
} }
} }
private void healPlayer(final Player p) private void healPlayer(final Player player)
{ {
p.setHealth(20); player.setHealth(player.getMaxHealth());
p.setFoodLevel(20); player.setFoodLevel(20);
p.sendMessage(_("heal")); player.sendMessage(_("heal"));
for (PotionEffect effect : p.getActivePotionEffects()) for (PotionEffect effect : player.getActivePotionEffects())
{ {
p.removePotionEffect(effect.getType()); player.removePotionEffect(effect.getType());
} }
} }
} }