Fixed issue #812 about a bug with slot_unlock trigger.

This commit is contained in:
Ka0rX 2023-05-04 09:11:17 +01:00
parent 061ced2207
commit f3aa07288f

View File

@ -14,7 +14,11 @@ public class UnlockSlotTrigger extends Trigger implements Removable {
public UnlockSlotTrigger(MMOLineConfig config) {
super(config);
config.validateKeys("slot");
slot = Integer.parseInt("slot");
try {
slot = Integer.parseInt(config.getString("slot"));
}catch(NumberFormatException e){
throw new IllegalArgumentException("The slot should be a number");
}
Validate.isTrue(slot > 0 && slot <= MMOCore.plugin.configManager.maxSkillSlots, "The slot should be between 1 and " + MMOCore.plugin.configManager.maxSkillSlots);
}