Skip to content

fix: bonemeal api in multiplayer#249

Open
Lemmmy wants to merge 1 commit intoModificationStation:developfrom
Lemmmy:fix/bonemeal-api-mp
Open

fix: bonemeal api in multiplayer#249
Lemmmy wants to merge 1 commit intoModificationStation:developfrom
Lemmmy:fix/bonemeal-api-mp

Conversation

@Lemmmy
Copy link
Copy Markdown

@Lemmmy Lemmmy commented Mar 28, 2026

This PR addresses a bug in the Bonemeal API where the reimplementation of the vanilla behaviour (use on grass, etc.) leads to client/server desyncs in multiplayer. Specifically, the new code in the Bonemeal API currently doesn't implement the same world.isRemote checks that DyeItem.java originally does. In multiplayer, this means that a player with Station API installed will see different plants grown than on the server, and in the case of grass, they may even see dead bushes (due to a block meta desync). This issue happens regardless of whether Station API is installed on the server.

For the implementation, I chose to delegate the responsibility of checking world.isRemote to the implementors of the generate function, leaving modders the flexibility to fine-tune which behaviour is ran on the client, and protect the return values so that the item animations are preserved properly. As such, I only wrapped the world-modifying calls in the replacement implementations for the vanilla generators, as well as the item stack consumption. This does mean that this PR won't fix the desync for mods using the Bonemeal API; those mods will need to make similar patches themselves.

I've tested that this works correctly in singleplayer and multiplayer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant