9
0
mirror of https://github.com/Auxilor/EcoSkills.git synced 2026-01-04 15:41:36 +00:00

Fixed data.yml being rolled back on /ecoskills reload

This commit is contained in:
_OfTeN_
2021-09-15 20:11:43 +03:00
parent 327a8ec2e5
commit 94044a444e

View File

@@ -3,7 +3,9 @@ package com.willfp.ecoskills.commands
import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.command.CommandHandler
import com.willfp.eco.core.command.impl.Subcommand
import com.willfp.ecoskills.EcoSkillsPlugin
import org.bukkit.command.CommandSender
import java.io.IOException
class CommandReload(plugin: EcoPlugin) :
Subcommand(
@@ -14,6 +16,11 @@ class CommandReload(plugin: EcoPlugin) :
) {
override fun getHandler(): CommandHandler {
return CommandHandler { sender: CommandSender, _: List<String> ->
try {
(plugin as EcoSkillsPlugin).dataYml.save()
} catch (e: IOException) {
e.printStackTrace()
}
plugin.reload()
sender.sendMessage(plugin.langYml.getMessage("reloaded"))
}