Changes

Summary

  1. Add some hints to generic loader registry about replacements for IHaveLoader (details)
  2. Deprecase parseColor in JsonHelper and migrate usages to IntLoadable (details)
  3. Implement two basic forms of maps (details)
  4. Implement full maps in loadables (details)
  5. Rename map to xmap in Loadables (details)
Commit caf9e33304a925faffb4f472769e577b8a7239f0 by KnightMiner
Add some hints to generic loader registry about replacements for IHaveLoader

Thats probably the most awkward part of the migration, as IAmLoadable.Record cannot just extend this due to generic differences.
The file was modifiedsrc/main/java/slimeknights/mantle/data/registry/GenericLoaderRegistry.java (diff)
Commit abf5ae765dd76bf160d1b9ab2f0286a8a1ceca25 by KnightMiner
Deprecase parseColor in JsonHelper and migrate usages to IntLoadable

Just more flexible and more clear with the two color types
The file was modifiedsrc/main/java/slimeknights/mantle/client/model/util/MantleItemLayerModel.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/fluid/texture/FluidTexture.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/util/JsonHelper.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/client/model/util/ColoredBlockModel.java (diff)
Commit b8d014751640046e357dafd2bac11b8e69f0aa95 by KnightMiner
Implement two basic forms of maps

Full maps will come in a later commit.
Form 1 has the map keys computed from the values, useful for parsing a map of ID to objects. Parsed from an array.
Form 2 has the map values computed from the keys, useful for caching a specific form of an object (e.g. item to itemstack). Parsed from an array.
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/Loadable.java (diff)
The file was addedsrc/main/java/slimeknights/mantle/data/loadable/mapping/AnyCollectionLoadable.java
Commit 24eb72c7c5c867b263af1fd465e7a1fca7b28fd8 by KnightMiner
Implement full maps in loadables

To make this work, added a new sub-interface of Loadable: StringLoadable. Represents any loadable that can be written directly into a string or read from a string.
MapLoadables require a string loadable as a key, but accept any loadable as a value. Intentionally did not implement RecordLoadable for them as the map keys will conflict with other objects
Strings, resource locations, booleans, enums, colors, and tag keys all implement StringLoadable and work as keys
Registries and named component registry both implement StringLoadable via the helper ResourceLocationLoadable
IntLoadable does not implement StringLoadable, but has a new asString() method to create a loadable for strings as int, with a radix argument.
Since StringLoadable used to be a record for different max lengths, that logic was moved to a package private class, can be built using a static helper on StringLoadable
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/primitive/BooleanLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/common/ColorLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/mapping/MappedLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/common/RegistryLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/primitive/EnumLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/Loadables.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/primitive/StringLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/registry/NamedComponentRegistry.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/primitive/IntLoadable.java (diff)
The file was addedsrc/main/java/slimeknights/mantle/data/loadable/mapping/MapLoadable.java
The file was addedsrc/main/java/slimeknights/mantle/data/loadable/primitive/MaxLengthStringLoadable.java
The file was addedsrc/main/java/slimeknights/mantle/data/loadable/primitive/ResourceLocationLoadable.java
The file was modifiedsrc/main/java/slimeknights/mantle/util/JsonHelper.java (diff)
Commit a22da914283c8164b75f09c25fdae447516c6448 by KnightMiner
Rename map to xmap in Loadables

This is done to prevent name conflict with StreamCodable#map in the future, along with to distinguish it from data structure maps better
The file was modifiedsrc/main/java/slimeknights/mantle/recipe/ingredient/EntityIngredient.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/Loadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/mapping/AnyCollectionLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/recipe/ingredient/FluidIngredient.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/common/ItemStackLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/primitive/StringLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/Loadables.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/common/FluidStackLoadable.java (diff)
The file was modifiedsrc/main/java/slimeknights/mantle/data/loadable/record/RecordLoadable.java (diff)