Added ability to get skill level from McMMOPlayerExperience events.

This commit is contained in:
GJ 2012-03-27 00:14:20 -04:00
parent dd170ec7ef
commit 933449f16b
2 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,7 @@ Key:
Version 1.3.04-dev Version 1.3.04-dev
+ Added McMMOPlayerRepairEvent for API usage - fires after completion of a repair. + Added McMMOPlayerRepairEvent for API usage - fires after completion of a repair.
+ Added ability to get skill level from McMMOPlayerExperience events
= Fixed Shake ability dropping bonemeal instead of ink for squids. = Fixed Shake ability dropping bonemeal instead of ink for squids.
= Fixed Green Terra & Super Breaker awarding 4x drops at high levels. = Fixed Green Terra & Super Breaker awarding 4x drops at high levels.
= Fixed summoned ocelots never changing skins. = Fixed summoned ocelots never changing skins.

View File

@ -6,19 +6,25 @@ import org.bukkit.event.player.PlayerEvent;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
public class McMMOPlayerExperienceEvent extends PlayerEvent{ public class McMMOPlayerExperienceEvent extends PlayerEvent {
protected SkillType skill; protected SkillType skill;
protected int skillLevel;
public McMMOPlayerExperienceEvent(Player player, SkillType skill) { public McMMOPlayerExperienceEvent(Player player, SkillType skill) {
super(player); super(player);
this.skill = skill; this.skill = skill;
this.skillLevel = skill.getSkillLevel(player);
} }
public SkillType getSkill() { public SkillType getSkill() {
return skill; return skill;
} }
public int getSkillLevel() {
return skillLevel;
}
/** Rest of file is required boilerplate for custom events **/ /** Rest of file is required boilerplate for custom events **/
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();