Properly close MySQL connections when server shuts down

This commit is contained in:
ASangarin 2020-12-15 17:45:33 +01:00
parent 88b59c6c2a
commit 0f6b6fc29c

View File

@ -368,6 +368,9 @@ public class MMOCore extends JavaPlugin {
for (Guild guild : dataProvider.getGuildManager().getAll()) for (Guild guild : dataProvider.getGuildManager().getAll())
dataProvider.getGuildManager().save(guild); dataProvider.getGuildManager().save(guild);
if(dataProvider instanceof MySQLDataProvider)
((MySQLDataProvider) dataProvider).close();
mineManager.resetRemainingBlocks(); mineManager.resetRemainingBlocks();
lootChests.getActive().forEach(chest -> chest.unregister(false)); lootChests.getActive().forEach(chest -> chest.unregister(false));