CloudburstMC / Protocol

A protocol library for Minecraft Bedrock Edition
https://git.io/ProtocolLib
Apache License 2.0
312 stars 95 forks source link

[3.0] Fix force experimental gameplay #180

Closed KCodeYT closed 1 year ago

KCodeYT commented 1 year ago

StartGamePacket#forceExperimentalGameplay is not an optional boolean, so if you send another boolean after the first one that already said that force experimental gameplay was enabled, the bytes afterwards are corrupted and this is resulting in the client closing the connection.

Tested with: https://github.com/CloudburstMC/Server/tree/refactor/items

startGamePacket.setForceExperimentalGameplay(OptionalBoolean.of(true));

Changed to:

startGamePacket.setForceExperimentalGameplay(true);
dktapps commented 1 year ago

This does not look correct, it is and always has been an optional to the best of my knowledge. You likely have some other encoding issue.