Solved How to pause onDisable() until task completed

Discussion in 'Plugin Development' started by Colby l, Nov 5, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Colby l

    When the server is reloaded with my plugin, everyone's flight is disabled. Part of my plugin is cancelling their fall damage event from the flight being disabled. But if the plugin is reloaded before the player falls, the HashMaps that stored the player names has been erased.

    So, when the server reloads, I'm wanting the server to wait for the players to either get their fall damage canceled, or to be on the ground before the server completely disables the plugin, so players don't take fall damage.

    Thanks for the help!
  2. Offline


    The simple solution would to not use the reload function of the server. Using /reload is known to cause issues with plugins and memory leaks.

    If you are having this issue with full server restarts as well, then you could just teleport them to the block below them when the server restarts/is reloaded.

    Finally, if you are willing to do a little extra work, you can just store data inside a database or a file that stores players that are flying when onDisable() is called, then handle it when the server starts / when the player logs in.
  3. Offline

    Colby l

    I ended up teleporting all the players to the ground upon the reload command.
Thread Status:
Not open for further replies.

Share This Page