Search in sources :

Example 1 with YourSkillsItem

use of com.archyx.aureliumskills.menu.items.YourSkillsItem in project AureliumSkills by Archy-X.

the class SkillsMenu method init.

public void init(Player player, InventoryContents contents) {
    // Fill item
    if (options.isFillEnabled()) {
        contents.fill(ClickableItem.empty(options.getFillItem()));
    }
    // Close item
    CloseItem closeItem = (CloseItem) options.getItem(ItemType.CLOSE);
    contents.set(closeItem.getPos(), ClickableItem.of(closeItem.getItem(player, locale), e -> player.closeInventory()));
    // Your skills item
    YourSkillsItem yourSkillsItem = (YourSkillsItem) options.getItem(ItemType.YOUR_SKILLS);
    contents.set(yourSkillsItem.getPos(), ClickableItem.empty(yourSkillsItem.getItem(player, locale)));
    // Skill items
    SkillTemplate skillTemplate = (SkillTemplate) options.getTemplate(TemplateType.SKILL);
    if (OptionL.isEnabled(Skills.FARMING)) {
        contents.set(skillTemplate.getPosition(Skills.FARMING), ClickableItem.of(skillTemplate.getItem(Skills.FARMING, playerData, player, locale), e -> open(player, playerData, Skills.FARMING)));
    }
    if (OptionL.isEnabled(Skills.FORAGING)) {
        contents.set(skillTemplate.getPosition(Skills.FORAGING), ClickableItem.of(skillTemplate.getItem(Skills.FORAGING, playerData, player, locale), e -> open(player, playerData, Skills.FORAGING)));
    }
    if (OptionL.isEnabled(Skills.MINING)) {
        contents.set(skillTemplate.getPosition(Skills.MINING), ClickableItem.of(skillTemplate.getItem(Skills.MINING, playerData, player, locale), e -> open(player, playerData, Skills.MINING)));
    }
    if (OptionL.isEnabled(Skills.FISHING)) {
        contents.set(skillTemplate.getPosition(Skills.FISHING), ClickableItem.of(skillTemplate.getItem(Skills.FISHING, playerData, player, locale), e -> open(player, playerData, Skills.FISHING)));
    }
    if (OptionL.isEnabled(Skills.EXCAVATION)) {
        contents.set(skillTemplate.getPosition(Skills.EXCAVATION), ClickableItem.of(skillTemplate.getItem(Skills.EXCAVATION, playerData, player, locale), e -> open(player, playerData, Skills.EXCAVATION)));
    }
    // Combat Skills
    if (OptionL.isEnabled(Skills.ARCHERY)) {
        contents.set(skillTemplate.getPosition(Skills.ARCHERY), ClickableItem.of(skillTemplate.getItem(Skills.ARCHERY, playerData, player, locale), e -> open(player, playerData, Skills.ARCHERY)));
    }
    if (OptionL.isEnabled(Skills.DEFENSE)) {
        contents.set(skillTemplate.getPosition(Skills.DEFENSE), ClickableItem.of(skillTemplate.getItem(Skills.DEFENSE, playerData, player, locale), e -> open(player, playerData, Skills.DEFENSE)));
    }
    if (OptionL.isEnabled(Skills.FIGHTING)) {
        contents.set(skillTemplate.getPosition(Skills.FIGHTING), ClickableItem.of(skillTemplate.getItem(Skills.FIGHTING, playerData, player, locale), e -> open(player, playerData, Skills.FIGHTING)));
    }
    if (OptionL.isEnabled(Skills.ENDURANCE)) {
        contents.set(skillTemplate.getPosition(Skills.ENDURANCE), ClickableItem.of(skillTemplate.getItem(Skills.ENDURANCE, playerData, player, locale), e -> open(player, playerData, Skills.ENDURANCE)));
    }
    if (OptionL.isEnabled(Skills.AGILITY)) {
        contents.set(skillTemplate.getPosition(Skills.AGILITY), ClickableItem.of(skillTemplate.getItem(Skills.AGILITY, playerData, player, locale), e -> open(player, playerData, Skills.AGILITY)));
    }
    // Magic Skills
    if (OptionL.isEnabled(Skills.ALCHEMY)) {
        contents.set(skillTemplate.getPosition(Skills.ALCHEMY), ClickableItem.of(skillTemplate.getItem(Skills.ALCHEMY, playerData, player, locale), e -> open(player, playerData, Skills.ALCHEMY)));
    }
    if (OptionL.isEnabled(Skills.ENCHANTING)) {
        contents.set(skillTemplate.getPosition(Skills.ENCHANTING), ClickableItem.of(skillTemplate.getItem(Skills.ENCHANTING, playerData, player, locale), e -> open(player, playerData, Skills.ENCHANTING)));
    }
    if (OptionL.isEnabled(Skills.SORCERY)) {
        contents.set(skillTemplate.getPosition(Skills.SORCERY), ClickableItem.of(skillTemplate.getItem(Skills.SORCERY, playerData, player, locale), e -> open(player, playerData, Skills.SORCERY)));
    }
    if (OptionL.isEnabled(Skills.HEALING)) {
        contents.set(skillTemplate.getPosition(Skills.HEALING), ClickableItem.of(skillTemplate.getItem(Skills.HEALING, playerData, player, locale), e -> open(player, playerData, Skills.HEALING)));
    }
    if (OptionL.isEnabled(Skills.FORGING)) {
        contents.set(skillTemplate.getPosition(Skills.FORGING), ClickableItem.of(skillTemplate.getItem(Skills.FORGING, playerData, player, locale), e -> open(player, playerData, Skills.FORGING)));
    }
}
Also used : CloseItem(com.archyx.aureliumskills.menu.items.CloseItem) TemplateType(com.archyx.aureliumskills.menu.templates.TemplateType) MenuMessage(com.archyx.aureliumskills.lang.MenuMessage) SmartInventory(fr.minuskube.inv.SmartInventory) OptionL(com.archyx.aureliumskills.configuration.OptionL) Player(org.bukkit.entity.Player) Nullable(org.jetbrains.annotations.Nullable) SkillTemplate(com.archyx.aureliumskills.menu.templates.SkillTemplate) AureliumSkills(com.archyx.aureliumskills.AureliumSkills) Lang(com.archyx.aureliumskills.lang.Lang) CloseItem(com.archyx.aureliumskills.menu.items.CloseItem) InventoryProvider(fr.minuskube.inv.content.InventoryProvider) InventoryContents(fr.minuskube.inv.content.InventoryContents) Locale(java.util.Locale) PlayerData(com.archyx.aureliumskills.data.PlayerData) Skill(com.archyx.aureliumskills.skills.Skill) ItemType(com.archyx.aureliumskills.menu.items.ItemType) YourSkillsItem(com.archyx.aureliumskills.menu.items.YourSkillsItem) Skills(com.archyx.aureliumskills.skills.Skills) ClickableItem(fr.minuskube.inv.ClickableItem) SkillTemplate(com.archyx.aureliumskills.menu.templates.SkillTemplate) YourSkillsItem(com.archyx.aureliumskills.menu.items.YourSkillsItem)

Aggregations

AureliumSkills (com.archyx.aureliumskills.AureliumSkills)1 OptionL (com.archyx.aureliumskills.configuration.OptionL)1 PlayerData (com.archyx.aureliumskills.data.PlayerData)1 Lang (com.archyx.aureliumskills.lang.Lang)1 MenuMessage (com.archyx.aureliumskills.lang.MenuMessage)1 CloseItem (com.archyx.aureliumskills.menu.items.CloseItem)1 ItemType (com.archyx.aureliumskills.menu.items.ItemType)1 YourSkillsItem (com.archyx.aureliumskills.menu.items.YourSkillsItem)1 SkillTemplate (com.archyx.aureliumskills.menu.templates.SkillTemplate)1 TemplateType (com.archyx.aureliumskills.menu.templates.TemplateType)1 Skill (com.archyx.aureliumskills.skills.Skill)1 Skills (com.archyx.aureliumskills.skills.Skills)1 ClickableItem (fr.minuskube.inv.ClickableItem)1 SmartInventory (fr.minuskube.inv.SmartInventory)1 InventoryContents (fr.minuskube.inv.content.InventoryContents)1 InventoryProvider (fr.minuskube.inv.content.InventoryProvider)1 Locale (java.util.Locale)1 Player (org.bukkit.entity.Player)1 Nullable (org.jetbrains.annotations.Nullable)1