Provide a modular default implementation of IAgeSymbol
One of the most common things that addons will want to do is add new symbols. Mystcraft exposes IAgeSymbol to make this possible, but it doesn't provide a default implementation. This leads to a lot of boilerplate that must be filled out before new symbols can be added, which should be similar if not identical across all addons. If this implementation supports pulling in symbols automatically from JSON files, then that allows many mods to add new symbols without any logic at all.
See Pages for 1.12 and similar mods for previous versions.
This base class will implement the standard boilerplate of grammar rules and treasure weights, but will delegate symbol registration logic to a behavior object. For instance there will be a behavior for block modifiers, a behavior for length modifiers, a behavior for color modifiers, etc... More complex symbols such as terrain generators will need to implement their own behaviors of course, but they could still make themselves configurable if there are some knobs to expose to JSON.
-
Add a final AgeSymbol
class that implementsIAgeSymbol
. -
Fill in logic for generatesConfigOption
-
Fill in logic for instabilityModifier
- Could provide a few different options in JSON
-
Fill in logic for getLocalizedName
-
Delegate registration logic to a behavior class designed for inheritance. -
Implement some default behaviors: -
Block modifiers -
Length modifiers -
Color modifiers -
Angle modifiers -
Direction modifiers
-
-
Add grammar rules to AgeSymbol base class -
Add treasure weights to AgeSymbol base class -
Add trade values to AgeSymbol base class -
Determine how to handle naming. - Most symbols will just want an unlocal string.
- Biomes and blocks (at least) will want to define a template and handle biomes/blocks with nonstandard localizations.
-
Serialize and deserialize to/from JSON. -
Register behaviors to a hash map from behavior name to the behavior class. -
Select appropriate behavior by name when parsing from JSON and pass a chunk of the JSON config to the behavior directly. -
Add a listener to the Forge registry event for IAgeSymbol -
Scan filesystem for ./config/mystcraft/agesymbols/*.json
files and automatically register them. -
Scan jars for *.jar/assets/*/agesymbols/*.json
files and automatically register them. -
If config folder symbols and jar symbols contain conflicting identifiers, prefer the config file. -
Detect and log duplicate registration errors. -
Final cleanup