Mineplex2018-withcommit/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFood.java

44 lines
881 B
Java
Raw Normal View History

2013-08-27 17:14:08 +02:00
package nautilus.game.arcade.kit.perks;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import mineplex.core.common.util.C;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.kit.Perk;
public class PerkFood extends Perk
{
private int _amount;
public PerkFood(int amount)
{
super("Strength", new String[]
{
C.cGray + "Your Hunger is permanently " + amount + "",
});
_amount = amount;
}
@EventHandler(priority = EventPriority.HIGH)
public void Update(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (Manager.GetGame() == null)
return;
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (Kit.HasKit(player))
{
player.setFoodLevel(_amount);
}
}
}
}