From 9ec6a6d1aad7b623728bc65a6a836bc9ee21a9ce Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 15 Feb 2013 13:07:43 -0500 Subject: [PATCH] Add constructor for adding multiple levels at once. Need to work out how to handle level-ups in order for this to be properly cancelled, however. --- .../events/experience/McMMOPlayerLevelUpEvent.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java b/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java index 52afd8452..2be27bb87 100644 --- a/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java +++ b/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerLevelUpEvent.java @@ -12,7 +12,12 @@ public class McMMOPlayerLevelUpEvent extends McMMOPlayerExperienceEvent { public McMMOPlayerLevelUpEvent(Player player, SkillType skill) { super(player, skill); - this.levelsGained = 1; // Always 1 for now as we call in the loop where the levelups are calculated, could change later! + this.levelsGained = 1; + } + + public McMMOPlayerLevelUpEvent(Player player, SkillType skill, int levelsGained) { + super(player, skill); + this.levelsGained = levelsGained; } /** @@ -21,4 +26,11 @@ public class McMMOPlayerLevelUpEvent extends McMMOPlayerExperienceEvent { public int getLevelsGained() { return levelsGained; } + + /** + * @param levelsGained int number of levels gained in this event + */ + public void setLevelsGained(int levelsGained) { + this.levelsGained = levelsGained; + } }