-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Biome modifiers don't sync modifications to client, climate/effect modifications are unworkable. #1204
Comments
Ah yeah, this has to do with how the new |
To make @lukebemish's idea more concrete: perhaps we can add an interface, let's call it For NeoForge, we would then implement that interface onto What do you think? |
Uh... I'm not sold on that approach. It seems overengineered. Fixing this -- or any equivalent issue that arises -- is as simple as stripping the KnownPack data if we modify datapack registry entries, from those entries. We don't need a whole new system in parallel to the vanilla one... |
A bit of a shotgun approach I think (and probably why I didn't think it up), but it would likely work as well (if possibly doing some needless synchronization for unmodified entries). Do you have the time to look into it, or shall I? |
I wouldn't remove that from every entry, I'd only remove it from entries targeted by modifiers. I'll probably have some time to give it a poke in the next day or so. |
Minecraft Version:
1.21
NeoForge Version:
21.0.37-beta
All testing happened on singleplayer, integrated server.
Overview
I have experienced this in a neo mod dev workspace, which I will try and convince you of via the following debugger screenshots:
Biome as visible to the server - climate settings are modified, modified biome info is present:
Biome as visible to the client - everything is defaulted:
Why is this a problem?
Modifications that affect structure or feature generation are perfectly fine to be server-only, since they aren't synced to the client typically. However climate and special effects are mostly/only used on client - it's effectively impossible to use a biome modifier to change the rendering of rain in a biome for example, or the water/fog colors.
Diagnosis
Using the same debugger from above, I can confirm that the coremod is applied to the network codec fields, and so would in theory try and sync the biome if timed properly:
This is reading the modified biome info, not the original. I have tried to breakpoint the flow of biome modifier application and synchronization:
ServerLifecycleHooks.handleServerAboutToStart()
ServerLifecycleHooks.getCurrentServer().registryAccess()
SynchronizeRegistriesTask.sendRegistries()
this.registries
also has modifications visible at this timeRegistrySynchronization.packRegistry
to pack individual registries, which we encounter a problem. This appears to check that is the biome loaded fromSet<KnownPack>
. I do not fully understand the purpose of this code, but what I think happens here, is vanilla realizes the biome in server (i.e.minecraft:badlands
) is loaded from the "minecraft:core:1.21
" pack, which is identical on client. and so it doesn't sync it, because it is (assumed to be) unmodified.ClientConfigurationPacketListenerImpl.handleRegistryData()
is called with the packed dataRegistryDataCollector.collectGameRegistries()
receives empty data, sets up registries, and the modifications are effectively voided at this pointFix?
I have no idea what this network registry sync code is doing but, probably, add a special case for
RegistrySynchronization.packRegistry()
to always sync biomes that have a biome modifier.I can confirm, at least in my mod dev environment, that this mixin fixes the issue. However, this is a completely brute-force approach called "just sync all biomes" forcibly.
The text was updated successfully, but these errors were encountered: