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:
@@ -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"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user