df-mc / dragonfly

Minecraft Bedrock Edition server software written in Go
https://discord.gg/U4kFWHhTNR
MIT License
676 stars 143 forks source link

Some items are sometimes incorrect in the inventory #217

Closed Sandertv closed 2 years ago

Sandertv commented 3 years ago

Sometimes, some of the items displayed in the (creative) inventory are incorrect. In such cases, honeycombs are displayed as a bottle of honey, warped fungus on a sticks are displayed as chains. (Potentially more of such items.)

This was reproduced both by me and @DaPigGuy. It seems to fix itself automatically when leaving and joining again. Maybe something wrong with the item runtime IDs. I am not sure what could be the cause of this. Item runtime IDs are consistent for as long as the server is running (and technically even afterwards). Multiple players can experience and not experience the bug simultaneously.

JustTalDevelops commented 3 years ago

Could it be the order of the item runtime IDs when sent in the start game packet? (unlikely, but worth a try?)

Sandertv commented 3 years ago

That possibility does exist yeah. We can try sorting them.

Sandertv commented 3 years ago

To add to the list, when this bug happens, amethyst shards show up as spyglasses.

Sandertv commented 3 years ago

Sorting the items does not fix it. This seems to reliably reproduce everytime you join the server for the first time after you restart the game (on Android). Rejoining afterwards immediately fixes it.

Sandertv commented 3 years ago

It seems that joining a different server first before joining Dragonfly also prevents the issue from happening.

Sandertv commented 3 years ago

This seems very likely to just be a client issue, where the client expects we send all items in the StartGame packet while we only send items we implement.