2012-03-27 07:09:28 +02:00
|
|
|
package com.gmail.nossr50.events.skills;
|
2012-03-27 05:01:51 +02:00
|
|
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
import org.bukkit.event.player.PlayerEvent;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.datatypes.SkillType;
|
|
|
|
|
2012-04-01 04:20:35 +02:00
|
|
|
/**
|
|
|
|
* Generic event for mcMMO skill handling.
|
|
|
|
*/
|
|
|
|
public class McMMOPlayerSkillEvent extends PlayerEvent {
|
2012-03-27 05:01:51 +02:00
|
|
|
protected SkillType skill;
|
|
|
|
protected int skillLevel;
|
|
|
|
|
|
|
|
public McMMOPlayerSkillEvent(Player player, SkillType skill) {
|
|
|
|
super(player);
|
|
|
|
this.skill = skill;
|
2012-03-27 06:18:04 +02:00
|
|
|
this.skillLevel = skill.getSkillLevel(player);
|
2012-03-27 05:01:51 +02:00
|
|
|
}
|
|
|
|
|
2012-04-01 04:20:35 +02:00
|
|
|
/**
|
|
|
|
* @return The skill involved in this event
|
|
|
|
*/
|
2012-03-27 05:01:51 +02:00
|
|
|
public SkillType getSkill() {
|
|
|
|
return skill;
|
|
|
|
}
|
|
|
|
|
2012-04-01 04:20:35 +02:00
|
|
|
/**
|
|
|
|
* @return The level of the skill involved in this event
|
|
|
|
*/
|
2012-03-27 21:57:37 +02:00
|
|
|
public int getSkillLevel() {
|
|
|
|
return skillLevel;
|
|
|
|
}
|
|
|
|
|
2012-03-27 05:01:51 +02:00
|
|
|
/** Rest of file is required boilerplate for custom events **/
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
2012-03-27 21:57:37 +02:00
|
|
|
|
2012-03-27 05:01:51 +02:00
|
|
|
@Override
|
|
|
|
public HandlerList getHandlers() {
|
|
|
|
return handlers;
|
|
|
|
}
|
2012-03-27 21:57:37 +02:00
|
|
|
|
2012-03-27 05:01:51 +02:00
|
|
|
public static HandlerList getHandlerList() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
}
|