Skip to content
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

fabric-registry-sync cannot be skipped #2168

Open
GStefanowich opened this issue Apr 27, 2022 · 6 comments
Open

fabric-registry-sync cannot be skipped #2168

GStefanowich opened this issue Apr 27, 2022 · 6 comments
Labels
registry-sync Pull requests and issues related to registry sync

Comments

@GStefanowich
Copy link

I've been receiving a lot of reports from players that use Fabric (Loader) to add custom blocks and items to the game that my mod has been kicking them from their servers after attempting to add my mod to their server.

My mod is designed to be a server-side only mod, and isn't required clientside. It adds a couple of BlockEntities because BlockEntities can give blocks better interaction with less overhead than a Mixin. For example, creating a CustomChestBlockEntity.class is easier than Mixing into and causing incompatibilities in the ChestBlockEntity.class by just entirely overriding it's functionality.

BlockEntities (in vanilla scenarios) are not synced with the client, because they're only used on the Logical Side.

Many mods rely on Fabric (API) as a Dependency, so it is present on many Fabric servers. fabric-registry-sync-v0 runs a sync between the client and the server upon trying to connect, to gaurantee mod-version compatibility between the two. If any Block / Item / Fluid / or BlockEntity is missing, it kicks the client with a warning.

Because my mod is ServerSide only, the only real fix for this situation currently is to start requiring the mod be installed ClientSide (which I'd like to avoid). Marking Fabric-API as incompatible would be unthinkable.

There doesn't seem to be any way to let my BlockEntities skip this sync'ing process either. From what I gather the sync'ing process only skips Vanilla Registries. If there was a way to mark a Registry Value as to be skipped, that'd be greatly appreciated.

@warjort
Copy link

warjort commented Apr 27, 2022

See #1921

Basically not synchronizing modded block entity types could mean the BlockEntityType registry has different entries/raw ids.
The raw id is just a "next number" so it is based on loading/registration order which can be different client/server.
Especially if you have server only mods like you have.
This can cause the wrong BlockEntityType to be deserialized on the client since mc 1.18.0.

They are not synced in vanilla because there are no mod block entity types, so the registries will agree client/server.
The order is just the list of registrations in BlockEntityTypes.

@GStefanowich
Copy link
Author

I'm not sure if it's a possible solution, if even possible at all, or sure of how difficult it might be.

Maybe sort the non-sync'ed registry entries at the end of the list? I'm not sure if a BlockEntity was #141 for example, and the client only had up to #139 if it would ignore the ID or throw an IndexOutOfRange.

@deirn deirn added the registry-sync Pull requests and issues related to registry sync label May 1, 2022
@Patbox
Copy link

Patbox commented May 17, 2022

Fabric registry sync supports skipping entries if you force it on server level. You could use library like polymer (created by me) to mark these block entity types as server side. Only real issue are BlockState ids, but these can be solved as well (polymer does that too)

@modmuss50
Copy link
Member

I did prototype an API to allow server only registry entries that arent synced to the client. At the time I couldnt find a valid usecase, it seems like I should revive that PR as its easy enough to do.

@GStefanowich
Copy link
Author

Hadn't even realized that that was a PR (It was over a year ago). Would be an awesome addition, especially since I've been seeing more and more "Server mods"- Not just my own mod.

@VelizarBG
Copy link

Now that #3004 is a thing can we please have some API like modmuss' prototype or Patbox's polymer-reg-sync-manipulator submodule where we can prevent a registry entry from being synced to the client so players can join without having it. Personally, I need it because I have a couple custom ArgumentTypes which are used on a sever's datapack but are not needed on the client and players shouldn't have to have them in order to play. Such a feature would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
registry-sync Pull requests and issues related to registry sync
Projects
None yet
Development

No branches or pull requests

6 participants