EbonJaeger / perworldinventory-kt

Multi-world inventory plugin for Spigot written in Kotlin.
MIT License
46 stars 32 forks source link

When the world is unloaded and player is teleported to spawn on server restart his inventories swaps #231

Open bobhenl opened 3 years ago

bobhenl commented 3 years ago

Describe the bug Hi, when I have PlayerWorldsPLugin and it's not loading worlds on startup... so worlds are loaded when player is teleported to them on their own (when he uses /pw tp , then when the server is restarting and player joins after restart, his inventory from his world is swapped into default world (so from group into default group), and when he goes back to the world he doesn't have his inventory there, cause the inventory "was moved" into default group (world = on spawn).

This setting helped me neither...

# Attempt to figure out which world a player last logged off in
# and save/load the correct data if that world is different.
# REQUIRES MC 1.9.2 OR NEWER
load-data-on-join: true

In Multiverse Inventories it especially this works, but there's another problem that isn't here.

To Reproduce Steps to reproduce the behavior: Optionally: use https://www.spigotmc.org/resources/%E2%AD%90-playerworldspro-%E2%AD%90-nether-and-the-end-support-async-loading-expiration-1-8-1-16-4.72113/updates

  1. Create world (you don't need the mentioned plugin)
  2. Create group and add there this created world, so when you go there you will have different inventory than in previous (spawn - main) world
  3. Stay in this world
  4. Unload the world from console
  5. Join again on the server, and boom your inventory is swapped into default one Btw not sure if it works like this, just I'm expecting what can happen without playerworldspro, but it's most likely this scenario.

With PWP (still don't need to use this plugin, just see what could happen):

  1. Don't set in config to load worlds on startup (CAUSE YOU WILL REACH LIMIT 128 ON BUNGEE IF YOU HAVE SO MANY PLAYERS)
  2. Reload plugin
  3. Create player world using it's commands
  4. Teleport there using it's commands
  5. Use /restart, /stop or something like this
  6. After you join back you will be in the spawn world with the inventory from YOUR world, so inventories are swapped.

Expected behavior When player joins after restart or after his world is unloaded, he still should use DEFAULT inventory instead of inventory from HIS world. This seems that this settings don't work then:

# Attempt to figure out which world a player last logged off in
# and save/load the correct data if that world is different.
# REQUIRES MC 1.9.2 OR NEWER
load-data-on-join: true

Plugin version

Server version 1.16.5