Data fixers for the post-1.20.1 world(s) #1749
Labels
area-Minecraft
This affects CC's Minecraft-specific content.
enhancement
An extension of a feature or a new feature.
help wanted
I haven't got the knowledge or time to work on this.
Every version, the way Minecraft stores game data (such as blocks and items) changes slightly. For instance, post 1.20.1 (the current version CC:T targets):
Minecraft handles this migration by using the DFU library. However, CC: Tweaked (like most mods), does not hook into it - DFU doesn't really have good support for mods (Mojang/DataFixerUpper#80), and (AFAIK) mod loaders have deemed adding support too complex to be worth it.
This is a problem for CC: Tweaked, as it means that worlds cannot be migrated between versions (or at least, not without some data loss).
It's not entirely clear what should be done here. At a bare-minimum, we should mixin to Minecraft's existing data-fixers, and register CC:T's block entities as inventories - this at least ensures items inside turtles (and disk drives and printers) will be migrated.
I'm less sure what to do about 1.20.5's components. I've not actually looked at how data-fixers for that are implemented - it may be quite simple to hook into as well, but failing that we can probably convert NBT on-the-fly, reading out of the
custom_nbt
component and adding our custom one instead.Turtle/pocket computer upgrades are a bit tricky here. Upgrade data may store item NBT which we'd want to migrate, but because it's currently unstructured, we can't automatically do so. Ideally we'd be able to expose data fixers for upgrade data too, but I don't think that's really possible :(. Maybe time to revisit #903?
The text was updated successfully, but these errors were encountered: