Creation of skillSlot class

This commit is contained in:
Ka0rX 2023-03-09 18:57:07 +01:00
parent 25e3b478d5
commit 4dce534d74

View File

@ -0,0 +1,24 @@
package net.Indyuce.mmocore.api.player.profess.skillslot;
import io.lumine.mythic.lib.api.math.BooleanExpressionParser;
import net.Indyuce.mmocore.skill.ClassSkill;
import org.bukkit.configuration.ConfigurationSection;
public class SkillSlot {
private final int slot;
private final String expression;
public SkillSlot(int slot, String expression) {
this.slot = slot;
this.expression = expression;
}
public SkillSlot(ConfigurationSection section) {
this.slot = Integer.parseInt(section.getName());
this.expression = section.getString("expression");
}
public boolean canBePlaced(ClassSkill classSkill) {
return new BooleanExpressionParser(expression).parse(classSkill.getSkill().getCategories());
}
}