Describe the bug
If a trade gets cancelled, tradesystem closes your inventory, however if the trade got cancelled because opening another gui then it could cause issues (for example in the KingdomsX plugin it let's you take items from the menus, althrough this requires a mod to execute a command while trading)
To Reproduce
Steps to reproduce the behavior:
Start a trade
Open another menu with a macro (for example I ran /k gui ranks/ranks which opens a KingdomsX menu)
The trade got cancelled, and the menu I opened with the macro is still open.
You can take items from the menu (it depends on the plugin)
Expected behavior
The inventory should close properly when cancelling a trade.
Describe the bug If a trade gets cancelled, tradesystem closes your inventory, however if the trade got cancelled because opening another gui then it could cause issues (for example in the KingdomsX plugin it let's you take items from the menus, althrough this requires a mod to execute a command while trading)
To Reproduce Steps to reproduce the behavior:
Expected behavior The inventory should close properly when cancelling a trade.
Screenshots Here is a video: https://imgur.com/a/PGHYdJg
Additional context Running this with a 0 tick scheduler fixes the issue: https://github.com/erikzimmermann/TradeSystem/blob/main/TradeSystem-Spigot/src/main/java/de/codingair/tradesystem/spigot/trade/Trade.java#L1133 I think this happens because the inv open and close event gets called the same tick and the other plugin (in this case KingdomsX) thinks that the player closed the menu, however minecraft didn't close it because it happened within the same tick, so waiting for the next tick seems to fix it
Discord contact: BenceX100