9
0
mirror of https://github.com/Auxilor/EcoSkills.git synced 2025-12-31 21:06:40 +00:00

Merge pull request #8

Fixed chat messages caching in gui lore cache && data.yml being rolled back on /ecoskills reload
This commit is contained in:
Will FP
2021-09-16 12:39:33 +01:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

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"))
}

View File

@@ -160,7 +160,7 @@ abstract class Skill(
messages.add(msg)
}
guiLoreCache[level] = messages
messagesCache[level] = messages
}
return StringUtils.formatList(messages, player)