Closed gamingrobot closed 9 years ago
When the player opens a new inventory or changes worlds, should these events get called again? So, not only once after joining, but every time the client gets back into a "ready" state?
nickelpro> That's because you're thinking of "inventory loading" and "chunk loading" as unique, discreet actions. When in fact they're just the first of their respective updates. It's completely within the server's rights to keep sending you new chunks, overwriting old ones, and never stop rechunking the client. The world is never "loaded", it has no final state, it just updates. This is even more true in 1.9 with the removal of bulk updates
I have to agree with @nickelpro the solution to the problem we are having is not to have loaded events but have more events for when the plugin is done processing the network PLAY events.
For the inventory, it makes sense to start doing stuff on inv_ready
or inv_open_window
:
https://github.com/SpockBotMC/SpockBot/compare/master...Gjum:window-open-feedback
This change delays the inv_open_window
to when all of the window's slots are received.
Maybe the event_tick
should also wait for PLAY_STATE
or cl_login_success
before being emitted, because that causes stuff like #129.
Ready to start moving can be a one time trigger off client_position_update and unregister event handler. There really is no finished to chunk downloading, so I will close this for now as we got more events to cover some of the issues.
Updated the description with the preferred ways to hook into these events.
These are higher level events that are triggered when certain things are ready when the player connects or moves dimensions in some cases.
See #132 and also https://github.com/andrewrk/mineflayer/issues/328
inventory_synced
once)Chunks downloaded(server keeps sending them, block search etc. can be done chunk-wise once they arrive)Ready to start moving(useclient_position_update
once)