Skip to content

Commit

Permalink
Fix mcMMOPlayerLevelChangeScriptEvent to properly listen for skill.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fortifier42 committed Jan 18, 2016
1 parent 3389343 commit bef7c3d
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -60,9 +60,12 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) {

@Override
public boolean matches(ScriptContainer scriptContainer, String s) {
String lower = CoreUtilities.toLowerCase(s);
String skill = CoreUtilities.getXthArg(2, lower);
return skill.equals("level") || SkillType.valueOf(skill.toUpperCase()) != null;
String arg = CoreUtilities.getXthArg(2, s).toUpperCase();
SkillType eventSkill = SkillType.valueOf(arg);
if (arg.equals("SKILL") || (eventSkill != null && eventSkill == event.getSkill())) {
return true;
}
return false;
}

@Override
Expand Down

0 comments on commit bef7c3d

Please sign in to comment.