mcMMO/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java

48 lines
1.2 KiB
Java
Raw Normal View History

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