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

42 lines
910 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.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.C;
import nautilus.game.arcade.kit.Perk;
public class PerkAxeman extends Perk
{
public PerkAxeman()
{
super("Axe Master", new String[]
{
C.cGray + "Deals +1 Damage with Axes",
});
}
@EventHandler(priority = EventPriority.HIGH)
public void AxeDamage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
if (damager.getItemInHand() == null)
return;
if (!damager.getItemInHand().getType().toString().contains("_AXE"))
return;
if (!Kit.HasKit(damager))
return;
event.AddMod(damager.getName(), GetName(), 1, false);
}
}