[1.20.1] Updated config on the server does not show the appropriate cost on clients side
ACE1337x opened this issue · 4 comments
I'm seeing a few posts here about the configs not working... In my case the configs do seem to work but the displayed information seems to just be the default. Even if the client and server have the same settings, the server appears to display the default costs to the client instead of the ones in the config, and it doesnt seem like the client config is loaded unless making/joining a singleplayer world first?
the server appears to display the default costs to the client instead of the ones in the config
Configs aren't synced from the server to clients, so this is expected. The displayed cost will only be correct if the client config matches the server config.
it doesnt seem like the client config is loaded unless making/joining a singleplayer world first
Oh, I think I know why this would be happening. It's an oversight that should be relatively simple to fix.
Actually, the config allows referring to registry entries (items and enchantments), which are defined on the server-side and can differ between worlds, making it a lot harder to just read the config when the client starts. This is what I get for pretty much only testing in singleplayer, I guess...
The "clean" solution for this is most likely to separate the client- and server-side parts of the config into different files so they can be independently read, and implement some sort of syncing of the server-side part to the client for the level cost display. I'll have to look into that.
The "clean" solution for this is most likely to separate the client- and server-side parts of the config into different files so they can be independently read, and implement some sort of syncing of the server-side part to the client for the level cost display. I'll have to look into that.
I actually implemented this for 1.21.4 (and later) now! In version 4.0.0, currently available as a beta on CurseForge and Modrinth, there are now two config files for the server and client, respectively, and the server config is synced to the client when joining worlds. This should solve the issue you're having.
Unfortunately, the underlying networking features that make this feasible were only introduced in 1.20.2 and 1.20.5. I generally don't support old Minecraft versions, but since you explicitly mentioned using 1.20.1, I would've backported this overhaul if it wasn't for that, sorry.
it doesnt seem like the client config is loaded unless making/joining a singleplayer world first
I think I can push a fix for this on 1.20.1, though.