From dd6082c8a12dffb31f4dac50f6f0b705fe80b035 Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 30 Mar 2012 01:01:48 -0400 Subject: [PATCH] Add ability to fire level-up event & notification with ExperienceAPI --- src/main/java/com/gmail/nossr50/api/ExperienceAPI.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java b/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java index f0133d869..77c346b39 100644 --- a/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java +++ b/src/main/java/com/gmail/nossr50/api/ExperienceAPI.java @@ -99,9 +99,14 @@ public class ExperienceAPI { * @param player The player to add levels to * @param skillType Type of skill to add levels to * @param levels Number of levels to add + * @param notify True if this should fire a level up notification, false otherwise. */ - public void addLevel(Player player, SkillType skillType, int levels) { + public void addLevel(Player player, SkillType skillType, int levels, boolean notify) { Users.getProfile(player).addLevels(skillType, levels); + + if (notify) { + checkXP(player, skillType); + } } /**