So I'm wondering how can I do the non-blocking request and await it's completion. If I set a callback function for http request, it gets executed in another thread, too. If I make the request in a separate thread, no blocking occurs but I've read in a lot of places that one should not call Minecraft functions from threads other than the main one. However, when putting all code in main thread, while the game waits for response, the fps drops to zero as expected. And, before the request finishes, there will be "Loading." message displayed. I'm in the following scenario: when a player opens a chest (inventory gui), my mod will make a http get request (which might take a while if the server is slow), and then update the chest contents depending om the response. Hello everyone, this may be more of a Java question but I couldn't find anything helpful on the internet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |