In /skills, auto select skill if there's only one

This commit is contained in:
Jules 2025-11-10 23:17:25 +01:00
parent 54956d55fc
commit c712f82bf2

View File

@ -508,6 +508,15 @@ public class SkillList extends EditableInventory {
enablePagination(skillSlots.size());
}
@Override
public void onOpen() {
// Auto select skill if there is only one skill slot
if (skillSlots.size() == 1) {
selected = skills.get(getPageIndex(0));
}
}
@Override
public @NotNull String getRawName() {
return guiName.replace("{skill}", selected.getSkill().getName());