NichtStudioCode / InvUI

A spigot library for creating custom inventory-based GUIs.
MIT License
242 stars 19 forks source link

Items stay in your inventory after server restart when using multi window #65

Closed Tuchan closed 6 months ago

Tuchan commented 7 months ago

Whenever you use a multi window and the server crashes, the items don't get restored after joining back.

Since the contents are already saved and restored... note

...would it be possible to serialize and save the player's inventory in a file (maybe datebase even) upon the server close? https://github.com/NichtStudioCode/InvUI/blob/f76896231c1be1bd4a7e9f09590d4debf8c05d3f/invui-core/src/main/java/xyz/xenondevs/invui/window/AbstractDoubleWindow.java#L26

This way, whenever a player joins back, it would see if the inventory was restored. If not, deserialize the data and: https://github.com/NichtStudioCode/InvUI/blob/f76896231c1be1bd4a7e9f09590d4debf8c05d3f/invui-core/src/main/java/xyz/xenondevs/invui/window/AbstractDoubleWindow.java#L64-L69

Tuchan commented 6 months ago

Can still reproduce on v1.26

NichtStudioCode commented 6 months ago

Can you send a minimal reproducible example, along with the server software version you're using?

Tuchan commented 5 months ago

Thanks GitHub for giving me a notification............. sorry.... (please ping me next time)

https://pastebin.com/C8iDej2j server version: paper-1.20.2-318.jar

NichtStudioCode commented 5 months ago

@Tuchan Also works fine for me. Both stopping the server and letting it be stopped by the watchdog thread call plugin disable, which closes the inventories.

Tuchan commented 5 months ago

Apparently, 3 out of 4 server instances are broken somehow and this feature doesn't work on them, but a completely fresh install of paper is fine. This is a user error. Sorry for the trouble.