My understanding of the Minecraft event loop is that all events, unless explicitly async are called on the main thread. Web3 calls can block for long periods of time. I would assume that calls like these https://github.com/NFT-Worlds/WRLD-Payments-API/blob/main/src/main/java/com/nftworlds/wallet/objects/NFTPlayer.java#L31-L32 need to run async in order to allow the event handler to complete quickly. After they complete, emit a custom event to update state and subscribe to that to again update on the main thread, or use runTaskLater which is the mini inside-the-closure form of the same thing.
In my plugins, I always try to exit from an event handler as quickly as possible and use threads and custom events to synchronize actions.
My understanding of the Minecraft event loop is that all events, unless explicitly async are called on the main thread. Web3 calls can block for long periods of time. I would assume that calls like these https://github.com/NFT-Worlds/WRLD-Payments-API/blob/main/src/main/java/com/nftworlds/wallet/objects/NFTPlayer.java#L31-L32 need to run async in order to allow the event handler to complete quickly. After they complete, emit a custom event to update state and subscribe to that to again update on the main thread, or use
runTaskLater
which is the mini inside-the-closure form of the same thing.In my plugins, I always try to exit from an event handler as quickly as possible and use threads and custom events to synchronize actions.