It was a fundamental misunderstanding on my part to think that only the logical server kept track of the item registry or that the item registry could be modified after launch (this has broader implications for any planned ModMenu integration). Even looking at several mods which have configs that customize the items registered and have settings adjustable via ModMenu, the item options are never tweakable without a restart.
So given that the number of tracks needs to a value that is:
This appears to work as intended on 1.19.2, because large parts of the Minecraft logic are implicitly logical-server-side or client-side. Namely, I have verified, with varying n_disc values set on independently on server and client, that:
the creative inventory is handled exclusively on the client-side (and thus 22d79ce67f7436796291b6081048de6d7b262b62 works as intended) [2]
comparator outputs are handled exclusively by the logical server (as I've set placeholder discs to universally have a comparator output strength of 0)
villager trades are handled exclusively by the logical server [3]
Outstanding Issues
Note that max_discs is technically the minimum number of discs--if n_discs is greater than max_discs, then all n_discs will be fully registered. This means that the whole "infinite tracks" stuff is still 100% valid, but if you're playing on a server with n_discs > 64, you're going to need to update max_discs on the client as well (while the error message for this is pretty clear to me, the mod's developer, this is absolutely something that should be caught and handled gracefully (BCLib has this great thing that offers to fix the the config issue and then prompts you to restart the game)
if the server's n_discs is greater than 7 and the client does not have any resource packs giving the textures for records beyond 7, they'll have no play sound (fine), no language entry (meh) and no texture (ew). This issue was already captured as #29.
Players in single-player or multiplayer with access to commands can obtain placeholder tracks (meh)
Once these changes are applied to the other branches, they will require explicitly testing with 1.19 and 1.19.3 (meaning we gotta reopen #8)
Unless the player is using a resource pack with 64 tracks specified their logs--on single-player or multiplayer--are going to get flooded with warnings about missing textures and sound files. This will also be resolved via #29.
Of these, only that last item (plus the validation story) I would consider as having any sort of severity, so I may watch some tutorials to see if I can get that figured out for the initial release.
Footnotes
[1] as I mentioned when I originally ran up against this issue, it does seem like the experience is functional if the server has fewer records registered than the client, but the behavior seemed extremely glitchy
[2] with client-side n_discs set to 3 and server-side n_discs set to 5, only records 1-3 show up in the creative inventory
![with client-side n_discs set to 3 and server-side n_discs set to 5, only records 1-3 show up in the creative inventory](https://user-images.githubusercontent.com/66568922/206779456-5596842b-68df-4d79-a43e-f9912d076dae.png)
[3] with client-side n_discs set to 3 and server-side n_discs set to 5, villagers will still offer discs 4 and 5
![with client-side n_discs set to 3 and server-side n_discs set to 5, villagers will still offer discs 4 and 5](https://user-images.githubusercontent.com/66568922/206779728-99aaf528-861e-443c-88c2-641da71d2a0f.png)
Band-aid solution to resolve #34
It was a fundamental misunderstanding on my part to think that only the logical server kept track of the item registry or that the item registry could be modified after launch (this has broader implications for any planned ModMenu integration). Even looking at several mods which have configs that customize the items registered and have settings adjustable via ModMenu, the item options are never tweakable without a restart.
So given that the number of tracks needs to a value that is:
I went ahead and semi-hard-coded it to an absurdly high number.
This appears to work as intended on 1.19.2, because large parts of the Minecraft logic are implicitly logical-server-side or client-side. Namely, I have verified, with varying
n_disc
values set on independently on server and client, that:Outstanding Issues
max_discs
is technically the minimum number of discs--ifn_discs
is greater thanmax_discs
, then alln_discs
will be fully registered. This means that the whole "infinite tracks" stuff is still 100% valid, but if you're playing on a server withn_discs
> 64, you're going to need to updatemax_discs
on the client as well (while the error message for this is pretty clear to me, the mod's developer, this is absolutely something that should be caught and handled gracefully (BCLib has this great thing that offers to fix the the config issue and then prompts you to restart the game)n_discs
is greater than 7 and the client does not have any resource packs giving the textures for records beyond 7, they'll have no play sound (fine), no language entry (meh) and no texture (ew). This issue was already captured as #29.Of these, only that last item (plus the validation story) I would consider as having any sort of severity, so I may watch some tutorials to see if I can get that figured out for the initial release.
Footnotes
[1] as I mentioned when I originally ran up against this issue, it does seem like the experience is functional if the server has fewer records registered than the client, but the behavior seemed extremely glitchy
[2] with client-side n_discs set to 3 and server-side n_discs set to 5, only records 1-3 show up in the creative inventory
![with client-side n_discs set to 3 and server-side n_discs set to 5, only records 1-3 show up in the creative inventory](https://user-images.githubusercontent.com/66568922/206779456-5596842b-68df-4d79-a43e-f9912d076dae.png)[3] with client-side n_discs set to 3 and server-side n_discs set to 5, villagers will still offer discs 4 and 5
![with client-side n_discs set to 3 and server-side n_discs set to 5, villagers will still offer discs 4 and 5](https://user-images.githubusercontent.com/66568922/206779728-99aaf528-861e-443c-88c2-641da71d2a0f.png)