diff --git a/src/main/java/dev/mrshawn/deathmessages/config/ConfigManager.java b/src/main/java/dev/mrshawn/deathmessages/config/ConfigManager.java index 78b0c0e..c55d06a 100644 --- a/src/main/java/dev/mrshawn/deathmessages/config/ConfigManager.java +++ b/src/main/java/dev/mrshawn/deathmessages/config/ConfigManager.java @@ -39,7 +39,6 @@ public void reload() { Messages.getInstance().reload(); PlayerDeathMessages.getInstance().reload(); Settings.getInstance().reload(); - UserData.getInstance().reload(); } public String backup(boolean excludeUserData) { diff --git a/src/main/java/dev/mrshawn/deathmessages/files/FileSettings.java b/src/main/java/dev/mrshawn/deathmessages/files/FileSettings.java index c010c52..51e56bc 100644 --- a/src/main/java/dev/mrshawn/deathmessages/files/FileSettings.java +++ b/src/main/java/dev/mrshawn/deathmessages/files/FileSettings.java @@ -1,8 +1,8 @@ package dev.mrshawn.deathmessages.files; -import dev.mrshawn.deathmessages.DeathMessages; import org.apache.logging.log4j.LogManager; import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.java.JavaPlugin; import java.io.File; import java.io.IOException; @@ -13,20 +13,22 @@ import java.util.Map; public class FileSettings> { + private final JavaPlugin plugin; private final String fileName; private final File file; private YamlConfiguration yamlConfig; private final Map, Object> values = new HashMap<>(); - public FileSettings(String fileName) { + public FileSettings(JavaPlugin plugin, String fileName) { + this.plugin = plugin; this.fileName = fileName; - this.file = new File(DeathMessages.getInstance().getDataFolder(), fileName); + this.file = new File(plugin.getDataFolder(), fileName); loadFile(); } private void loadFile() { if (!file.exists()) { - DeathMessages.getInstance().saveResource(fileName, false); + plugin.saveResource(fileName, false); } } diff --git a/src/main/kotlin/dev/mrshawn/deathmessages/kotlin/files/FileStore.kt b/src/main/kotlin/dev/mrshawn/deathmessages/kotlin/files/FileStore.kt index 2bf592b..bca771d 100644 --- a/src/main/kotlin/dev/mrshawn/deathmessages/kotlin/files/FileStore.kt +++ b/src/main/kotlin/dev/mrshawn/deathmessages/kotlin/files/FileStore.kt @@ -1,9 +1,10 @@ package dev.mrshawn.deathmessages.kotlin.files +import dev.mrshawn.deathmessages.DeathMessages import dev.mrshawn.deathmessages.files.Config import dev.mrshawn.deathmessages.files.FileSettings object FileStore { val CONFIG: FileSettings = - FileSettings("Settings.yml").loadSettings(Config::class.java) + FileSettings(DeathMessages.getInstance(), "Settings.yml").loadSettings(Config::class.java) } \ No newline at end of file