-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Crash] Deserialize dynamic registry by server codec at client side in singleplayer #4423
Comments
This behaviour comes from vanilla code. The "network codec" must be able to also read any data pack files on the client as vanilla has an optimisation where entries from "known data packs" aren't synced at all but are instead read directly on the client. This uses the network codec to avoid reading unnecessary data that the client doesn't need. "Network codec" is actually a misnomer and the codecs would be more accurately named "server codec" and "client codec". The optimisation and the codec names were discussed on Fabricord just a week ago: https://discord.com/channels/507304429255393322/566276937035546624/1334925452791513230 |
Not related to "network codec". Actually, the game uses (Though I wrote wrong |
Ah, this might actually be a different issue since this is the server side registry load (you can see it from The issue here is that you're trying to refer to the loot table registry in a "normal" dynamic registry. All the loot-related data types are so-called reloadable dynamic registries which are loaded in their own phase which occurs later (and they can be reloaded if data packs change). Using a I think we could add support for custom reloadable registries in a PR, but the crash seems to be the expected behaviour here. (The misnomer is still real though, even if unrelated. 😛) Edit: a good fix would be to use |
I use |
You can use an |
Is there anyway to defer the deserialization of my dynamic registry? |
The only way to really defer it in this case is to use a mixin and insert your registry into the loot pipeline (= make it a reloadable registry). |
0.114.0+1.21.1
DynamicRegistries.registerSynced(RegistryKey<? extends Registry<T>> key, Codec<T> dataCodec, Codec<T> networkCodec, SyncOption... options)
, where thedataCodec
is the codec using a server only registry and thenetworkCodec
is the codec without server only registry.The text was updated successfully, but these errors were encountered: