Acknowledge returning to configuration state if in play state. (#1284)

* Acknowledge returning to configuration state if in play state.

* Fix packet spelling
This commit is contained in:
William Gaylord 2024-02-03 17:07:30 -06:00 committed by GitHub
parent 21240f8ab2
commit 092e10c53d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,6 +47,10 @@ module.exports = function (client, options) {
function enterConfigState () {
if (client.state === states.CONFIGURATION) return
// If we are returning to the configuration state from the play state, we ahve to acknowledge it.
if (client.state === states.PLAY) {
client.write('configuration_acknowledged', {})
}
client.state = states.CONFIGURATION
// Server should send finish_configuration on its own right after sending the client a dimension codec
// for login (that has data about world height, world gen, etc) after getting a login success from client