diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/rpg/admin/SlotCommandTreeNode.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/rpg/admin/SlotCommandTreeNode.java index f7fd32fe..d274b5ca 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/rpg/admin/SlotCommandTreeNode.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/rpg/admin/SlotCommandTreeNode.java @@ -53,7 +53,15 @@ public class SlotCommandTreeNode extends CommandTreeNode { sender.sendMessage(ChatColor.RED + "The slot can't be negative."); 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); + if(skillSlot.isUnlockedByDefault()){ + sender.sendMessage(ChatColor.RED + "You can't lock a skill that is unlocked by default."); + return CommandResult.FAILURE; + } if (lock) { if (!playerData.hasUnlocked(skillSlot)) { CommandVerbose.verbose(sender, CommandVerbose.CommandType.SKILL, ChatColor.RED + "The skill slot " + skillSlot.getName() + " is already locked" + " for " + player.getName());