mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-10 20:09:58 +00:00
bf203bb1f3
Ever since 1.17, turtle and pocket upgrades have been loaded from datpacks, rather than being hard-coded in Java. However, upgrades have always been stored in our own registry-like structure, rather than using vanilla's registries. This has become a bit of a problem with the introduction of components. The upgrade components now hold the upgrade object (rather than just its id), which means we need the upgrades to be available much earlier (e.g. when reading recipes). The easiest fix here is to store upgrades in proper registries instead. This means that upgrades can no longer be reloaded (it requires a world restart), but otherwise is much nicer: - UpgradeData now stores a Holder<T> rather than a T. - UpgradeSerialiser has been renamed to UpgradeType. This now just provides a Codec<T>, rather than JSON and network reading/writing functions. - Upgrade classes no longer implement getUpgradeID(), but instead have a getType() function, which returns the associated UpgradeType. - Upgrades are now stored in turtle_upgrade (or pocket_upgrade) rather than turtle_upgrades (or pocket_upgrades). This will break existing datapacks, sorry! |
||
---|---|---|
.. | ||
client/java/dan200/computercraft/api/client/turtle | ||
main/java/dan200/computercraft |