forked from Upstream/mmocore
Better error handling for slot lock command.
This commit is contained in:
parent
fa9c24589b
commit
061ced2207
@ -53,7 +53,15 @@ public class SlotCommandTreeNode extends CommandTreeNode {
|
|||||||
sender.sendMessage(ChatColor.RED + "The slot can't be negative.");
|
sender.sendMessage(ChatColor.RED + "The slot can't be negative.");
|
||||||
return CommandResult.FAILURE;
|
return CommandResult.FAILURE;
|
||||||
}
|
}
|
||||||
|
if (slot > MMOCore.plugin.configManager.maxSkillSlots) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "The slot can't be higher than " + MMOCore.plugin.configManager.maxSkillSlots + ".");
|
||||||
|
return CommandResult.FAILURE;
|
||||||
|
}
|
||||||
SkillSlot skillSlot = playerData.getProfess().getSkillSlot(slot);
|
SkillSlot skillSlot = playerData.getProfess().getSkillSlot(slot);
|
||||||
|
if(skillSlot.isUnlockedByDefault()){
|
||||||
|
sender.sendMessage(ChatColor.RED + "You can't lock a skill that is unlocked by default.");
|
||||||
|
return CommandResult.FAILURE;
|
||||||
|
}
|
||||||
if (lock) {
|
if (lock) {
|
||||||
if (!playerData.hasUnlocked(skillSlot)) {
|
if (!playerData.hasUnlocked(skillSlot)) {
|
||||||
CommandVerbose.verbose(sender, CommandVerbose.CommandType.SKILL, ChatColor.RED + "The skill slot " + skillSlot.getName() + " is already locked" + " for " + player.getName());
|
CommandVerbose.verbose(sender, CommandVerbose.CommandType.SKILL, ChatColor.RED + "The skill slot " + skillSlot.getName() + " is already locked" + " for " + player.getName());
|
||||||
|
Loading…
Reference in New Issue
Block a user