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 2836c0862d
commit d9ee9b036c

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);
p.setFoodLevel(20);
p.sendMessage(_("heal"));
for (PotionEffect effect : p.getActivePotionEffects())
player.setHealth(player.getMaxHealth());
player.setFoodLevel(20);
player.sendMessage(_("heal"));
for (PotionEffect effect : player.getActivePotionEffects())
{
p.removePotionEffect(effect.getType());
player.removePotionEffect(effect.getType());
}
}
}