Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spectator to gameModes array #3012

Merged
merged 2 commits into from
May 13, 2023

Conversation

zefir-git
Copy link
Contributor

@zefir-git zefir-git commented Apr 7, 2023

This PR is a fix to the following bug: When in spectator mode, bot.game.gameMode is undefined.

The affected lines were first implemented in ad52fca.

@IceTank
Copy link
Contributor

IceTank commented May 12, 2023

Lgtm, I guess. But this won't make spectator mode work in general. Mineflayers physics currently can't simulate spectator mode.

@zefir-git
Copy link
Contributor Author

zefir-git commented May 12, 2023

Lgtm, I guess. But this won't make spectator mode work in general. Mineflayers physics currently can't simulate spectator mode.

Isn't spectator mode literally no physics? In any case, this PR was to fix that bot.game.gameMode is undefined when in spectator mode

@extremeheat extremeheat merged commit f813e5f into PrismarineJS:master May 13, 2023
@extremeheat
Copy link
Member

Thanks for the contribution

@zefir-git zefir-git deleted the patch/spectator-gamemode branch May 14, 2023 04:48
@IceTank
Copy link
Contributor

IceTank commented May 15, 2023

Lgtm, I guess. But this won't make spectator mode work in general. Mineflayers physics currently can't simulate spectator mode.

Isn't spectator mode literally no physics? In any case, this PR was to fix that bot.game.gameMode is undefined when in spectator mode

If you want a real 'correct' implementation you would implement the flying physics. Things like drag when flying, correct speed limits and overshooting when letting go of control states.
Creative fly is also not implemented. Right now it just disables physics calculations and teleports the bot in a certain direction. It does not send the proper start flying packets and does not update the bots position to the server over time as physics calculations are turned off.

@zefir-git
Copy link
Contributor Author

zefir-git commented May 15, 2023

@IceTank implementing spectator mode physics is beyond the scope of this PR. The scope of this PR is to fix a bug. With the bug, when in spectator mode, you have no way to know that you are. bot.game.gameMode used to be undefined. What this PR fixes is that. Now you can correctly check what your game mode is.

@IceTank
Copy link
Contributor

IceTank commented May 15, 2023

@IceTank implementing spectator mode physics is beyond the scope of this PR. The scope of this PR is to fix a bug. With the bug, when in spectator mode, you have no way to know that you are. bot.game.gameMode used to be undefined. What this PR fixes is that. Now you can correctly check what your game mode is.

Yes. That is correct. I just want to clarify in case anyone thinks that creative flying or spectator flying is implemented. Which it is not.

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.

None yet

3 participants