Closed aria1th closed 2 years ago
This is not a good solution. The reason for this issue is that you are running off-thread and this issue will be fixed when you run on the main thread. The client knows what items the villager is selling already so it doesn't need the server to tell it so, I read the code and it does this. tradeSelected
will work right after selectTrade
if you run on the main thread.
There are also a few issues with your code but I won't review because I won't merge this anyways.
this situation explains the need for this
It won't trade, because screen is not synced. However since we know server will have something in their screen, we can safely click output slot even if we don't see something. It enables much faster trading. We can do same thing for "selecting Trade" because selecting trade packet does not require any screen handler reference.
It also means trading can be 'instant' - you can omit waiting process.