PerWorldInventory icon indicating copy to clipboard operation
PerWorldInventory copied to clipboard

Potential compatibility issue with minigame plugins

Open blablubbabc opened this issue 7 years ago • 4 comments

Consider this situation:

  • Some minigame plugin is restoring player inventories and teleports players back to their original location, when the plugin is getting shut down.
  • The minigame world and the player's original world are in different groups in PWI.
  • PWI is getting disabled before this minigame plugin (loading order is basically arbitrary, if those plugins don't specify any dependencies between each other).
  • PWI config has 'load-data-on-join' enabled.

Observed problem:

  • Due to the shutdown order, PWI will store the player's current inventory and location, before the minigame plugin restores the inventory and teleports the player to his original location.
  • When the player joins the server again, PWI will notice that the player's location has changed and will restore the saved inventory, which is the minigame inventory.
  • The player's original inventory is lost.

Unfortunely I have no good idea for fixing this: Somehow PWI would need to disable after all other plugins / enabled before every other plugin, so that it sees the player's latest inventory when shutting down and saving. Unfortunely there is no option inside bukkit to load before all other plugins (besides maybe using load: STARTUP ...).

Currently this means that every minigame plugin out there (and every plugin doing similar things during shutdown) will have to add PWI in their soft-dependencies, to ensure that PWI gets loaded first / disabled later.

It might make sense to add some notice about this potential compatibility issue somewhere in the plugin's description for the time being. And maybe find a way to solve this on PWI's side instead someday, or get the spigot devs to add something to the plugin.yml for this situation.

blablubbabc avatar Jan 03 '18 21:01 blablubbabc

i tested it and i can confirm it. huge mess :(

ScuroK avatar Jan 04 '18 00:01 ScuroK

Minigame plugins and inventory separation plugins have always been a giant mess, sadly, for exactly this reason. And as far as I can tell, there is no real solution to the problem, except having your minigames in the same world and players just get sent to a lobby in that same world as well. :/

EbonJaeger avatar Jan 04 '18 17:01 EbonJaeger

i think you are wrong. my players WERE in the same world when they joined the minigame but still lost the inventory on server restart. And back in the days we didnt have this problem (using the same plugins but other versions)

ScuroK avatar Jan 04 '18 17:01 ScuroK

@Gnat008 This will not be improved in your rewrite?

bc-hill avatar Feb 12 '18 05:02 bc-hill