From 933449f16b3dd111946801e3ba9cbd5c1d8868b8 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 27 Mar 2012 00:14:20 -0400 Subject: [PATCH] Added ability to get skill level from McMMOPlayerExperience events. --- Changelog.txt | 1 + .../gmail/nossr50/events/McMMOPlayerExperienceEvent.java | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 74bc016e7..bf18b0d99 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -9,6 +9,7 @@ Key: Version 1.3.04-dev + 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 Green Terra & Super Breaker awarding 4x drops at high levels. = Fixed summoned ocelots never changing skins. diff --git a/src/main/java/com/gmail/nossr50/events/McMMOPlayerExperienceEvent.java b/src/main/java/com/gmail/nossr50/events/McMMOPlayerExperienceEvent.java index 4e393161c..d1672cbbf 100644 --- a/src/main/java/com/gmail/nossr50/events/McMMOPlayerExperienceEvent.java +++ b/src/main/java/com/gmail/nossr50/events/McMMOPlayerExperienceEvent.java @@ -6,19 +6,25 @@ import org.bukkit.event.player.PlayerEvent; import com.gmail.nossr50.datatypes.SkillType; -public class McMMOPlayerExperienceEvent extends PlayerEvent{ +public class McMMOPlayerExperienceEvent extends PlayerEvent { protected SkillType skill; + protected int skillLevel; public McMMOPlayerExperienceEvent(Player player, SkillType skill) { super(player); this.skill = skill; + this.skillLevel = skill.getSkillLevel(player); } public SkillType getSkill() { return skill; } + public int getSkillLevel() { + return skillLevel; + } + /** Rest of file is required boilerplate for custom events **/ private static final HandlerList handlers = new HandlerList();