mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Fix skillreset argument validation. Fixes #2651
This commit is contained in:
parent
dd01504111
commit
8927e16b1f
@ -45,7 +45,15 @@ public class SkillresetCommand implements TabExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), SkillType.getSkill(args[0]));
|
SkillType skill;
|
||||||
|
if (args[0].equalsIgnoreCase("all")) {
|
||||||
|
skill = null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skill = SkillType.getSkill(args[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
editValues((Player) sender, UserManager.getPlayer(sender.getName()).getProfile(), skill);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@ -140,7 +148,7 @@ public class SkillresetCommand implements TabExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean validateArguments(CommandSender sender, String skillName) {
|
private boolean validateArguments(CommandSender sender, String skillName) {
|
||||||
return !(CommandUtils.isInvalidSkill(sender, skillName) && !skillName.equalsIgnoreCase("all"));
|
return skillName.equalsIgnoreCase("all") || !CommandUtils.isInvalidSkill(sender, skillName);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
|
protected static void handleSenderMessage(CommandSender sender, String playerName, SkillType skill) {
|
||||||
|
Loading…
Reference in New Issue
Block a user