Multiverse / Multiverse-Inventories

BSD 3-Clause "New" or "Revised" License
93 stars 81 forks source link

Item switch on world change seems to be scheduled and not directly called? #521

Open Tigerpanzer02 opened 1 year ago

Tigerpanzer02 commented 1 year ago

Information

Help request

Tried to contact you on discord support channel on 25.02.2023 without any response.

Hey, I am the developer of some Minigame plugins e.g. BuildBattle. Some users got issues using my minigames with mv inventories. I want to debug this and get some knowledge why this does happen. And if the code issue is on my half or mv halfs.

Basically the issue is if player from world A (lobby) joins the minigame in world B the player won't receive the minigame items on world b, after leaving the minigame on b he will be at the end location in world a (lobby) again but now he does have the items of world b from the minigame that should be already removed and only viewable on the minigame. Now it would be easy to blame the minigame and say its my fault, okay fair enough, but without using mv inventories the issues can't be reproduced. Thats why I am here to determine the real issue.

What does the minigame plugin do? It teleports via entity.teleport(location); and prepares the player after that for the game by giving the items with playerInventory.addItem(itemStack); For reference see https://github.com/Plugily-Projects/MiniGamesBox/blob/f6ee1a18c0798364e1bde13686f0e6f4f9e623b7/MiniGamesBox%20Classic/src/main/java/plugily/projects/minigamesbox/classic/arena/PluginArenaUtils.java#L73

What a pr request on our side tries - to avoid the issue using compleablefuture to see if the teleport is done and wait until that, okay but shouldn't it be working with plain spigot methods also?, further reference https://github.com/Plugily-Projects/MiniGamesBox/pull/22/commits/f3955d5e893aebe60e3112c3a7a2d3b3ff7eb7b8#diff-e42e58d278eb88af5d61f8248a6dbb9dd6afc50cef34275965f927a4f7d41b94R175

Is there any setting in mv to change that behaviour or do you have any other advice? e.g. why its not working by default how its handled now without the pr? May there is some reason as mv inventories loads the inventories later than I do, and thats why its empty.

Server logs https://mclo.gs/cHWm9ZI /mvv -p https://paste.gg/p/anonymous/e4348824b9004b87a6c048642936b97a

videos https://youtu.be/m8MlHcbzr00 https://youtu.be/HahEFFXOxdA

Waterman1001 commented 1 year ago

I am wondering the same thing. It would be nice if someone could help out!

Waterman1001 commented 1 year ago

bump