hollow-cube / minestom-ce

1.20.4 Lightweight Minecraft server
https://minestom.net
Apache License 2.0
108 stars 36 forks source link

Fix server replaying the close window packet #111

Closed GreatWyrm closed 7 months ago

GreatWyrm commented 8 months ago

Currently, the server sends the Close Window packet when receiving a Close Window packet from the client.

This is due to calling Player#closeInventory() when receiving the Close Window packet from the client, which updates the server's internal state and sends the close window packet to the player.

I have changed this to simply update the server's internal state and not send the packet, and added a test to catch the issue in the future.

Minestom issue: https://github.com/Minestom/Minestom/issues/713.

mworzala commented 7 months ago

This looked like an unfortunate rebase so I cherry picked the commit