1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2025-07-05 07:04:44 +02:00

Fixed a bug involving SubSkill notifications

Fixes , also fixed the notification timer
This commit is contained in:
nossr50
2019-03-30 16:56:00 -07:00
parent 5ce360d443
commit 7757e187be
4 changed files with 17 additions and 5 deletions
Changelog.txtpom.xml
src/main/java/com/gmail/nossr50

@ -16,6 +16,7 @@ import java.util.HashMap;
public class RankUtils {
private static HashMap<String, HashMap<Integer, Integer>> subSkillRanks;
private static int count = 0;
/**
*
@ -26,8 +27,6 @@ public class RankUtils {
*/
public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel)
{
int count = 0;
for(SubSkillType subSkillType : primarySkillType.getSkillAbilities())
{
int playerRankInSkill = getRank(mcMMOPlayer.getPlayer(), subSkillType);
@ -36,20 +35,25 @@ public class RankUtils {
//If the skill doesn't have registered ranks gtfo
if(innerMap == null || innerMap.get(playerRankInSkill) == null)
return;
continue;
//The players level is the exact level requirement for this skill
if(newLevel == innerMap.get(playerRankInSkill))
{
SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel);
skillUnlockNotificationTask.runTaskLater(plugin, ((count * 4) + 1) * 20);
skillUnlockNotificationTask.runTaskLater(plugin, (count * 100));
count++;
}
}
}
public static void resetUnlockDelayTimer()
{
count = 0;
}
/* NEW SYSTEM */
private static void addRanks(AbstractSubSkill abstractSubSkill)
{