Package de.Keyle.MyPet.api.skill
Interface UpgradeParser<S extends Skill>
- Type Parameters:
S- the skill this parser produces upgrades for
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Reads one level's upgrade for a skill out of a skilltree's JSON.
-
Method Summary
Modifier and TypeMethodDescriptionparse(JsonObject upgradeJson) Parses anUpgradefor skillSfrom a skilltree JSON node.
-
Method Details
-
parse
Parses anUpgradefor skillSfrom a skilltree JSON node.Called by the skilltree loader for each
Skills.<name>.Upgrades.<level>block in an.st.jsonfile. TheupgradeJsonobject is the JSON object directly under the level rule (e.g.{"damage": "+5"}).Return
nullif the JSON cannot be parsed into a valid upgrade — the loader will log and skip the entry. Returning an upgrade with no modifiers set (e.g., all fields absent from the JSON) is also valid; the loader will install it as a no-op upgrade for that level.- Parameters:
upgradeJson- the JSON block under the level rule- Returns:
- the parsed upgrade, or
nullwhen the block cannot be read
-