Solved Saving on Disable

Discussion in 'Plugin Development' started by Orange Tabby, Jan 30, 2016.

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

    Orange Tabby

    Hello, I'm making an economy plugin for a server. I have it so when a player joins or quits it saves and loads there balance with Asynchronously task and this works, but I need to make it work with reloads. so I just did the same method saving all players online with Asynchronously task but this gives me an error my plugin can't schedule a task while disabling. What would be the best method without lag?
     
  2. Offline

    Zombie_Striker

    Unless you fully understand how to manage asynchronous threads, please use minecrafts thread. Regardless, why would you need it to by async?

    onDisabled is called whenever the plugin is disabled. This includes when the server is shutdown and during reloads. When the server reloads, all plugins are disabled and then re-enabled. Simply loop through all players online in the onEnabled and treat them as though they just joined the server.
     
Thread Status:
Not open for further replies.

Share This Page