This commit is contained in:
Ka0rX 2023-09-05 21:07:30 +01:00
parent 55953d41ce
commit 3fa278a920

View File

@ -57,7 +57,7 @@ public class ClassSelect extends EditableInventory {
private final PlayerClass playerClass;
public ClassItem(ConfigurationSection config) {
super(Material.BARRIER, config);
super(config.contains("item") ? Material.valueOf(UtilityMethods.enumName(config.getString("item"))) : Material.BARRIER, config);
Validate.isTrue(config.getString("function").length() > 6, "Couldn't find the class associated to: " + config.getString("function"));
String classId = UtilityMethods.enumName(config.getString("function").substring(6));