pufmat / skillsmod

A Minecraft mod that adds a fully configurable skill system to the game.
Other
36 stars 10 forks source link

getUnlockedSkills replacement #32

Closed Sweenus closed 1 year ago

Sweenus commented 1 year ago

Hi there 👋

With the removal of getUnlockedSkills from the API in the latest version, is there an alternate way I can access this information?

pufmat commented 1 year ago

Use SkillsAPI.getCategory(...) and then Category.getUnlockedSkills(...).

Sweenus commented 1 year ago

Use SkillsAPI.getCategory(...) and then Category.getUnlockedSkills(...).

Perfect! Thank you 🙂

Sweenus commented 1 year ago

Sorry for all the questions. Is there an easy way to match a skill against the definitions/skills file?

Previously, getUnlockedSkills returned the literal IDs found in the Skills.json, which allowed me to create an index of public strings I could access to execute player abilities when specific skills were unlocked.

This is no longer the case and I'm not too sure how to convert the ouptut of getUnlockedSkills into something I can match against the Definitions.json or Skills.json.

pufmat commented 1 year ago

To get ID like in the old API you can call Skill.getId().

If you have more questions you can message me on Discord, my username is pufmat.

Sweenus commented 1 year ago

Thank you! That sent me down the right path and I have it all working now. And thank you for offering a direct line of communication. I've felt a little bad spamming your issue tracker like this 🙂