From a5dd9b74a96da6ad532bd0af0815920875f3b451 Mon Sep 17 00:00:00 2001 From: jascotty2 Date: Fri, 4 Oct 2019 09:08:58 -0500 Subject: [PATCH] change getConfig to be easier to use in external API --- Core/src/main/java/com/songoda/core/SongodaPlugin.java | 8 ++++++-- .../core/configuration/editor/PluginConfigGui.java | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/songoda/core/SongodaPlugin.java b/Core/src/main/java/com/songoda/core/SongodaPlugin.java index b65d3d2f..9c2595fc 100644 --- a/Core/src/main/java/com/songoda/core/SongodaPlugin.java +++ b/Core/src/main/java/com/songoda/core/SongodaPlugin.java @@ -9,6 +9,7 @@ import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.ConsoleCommandSender; +import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.plugin.java.JavaPlugin; /** @@ -44,11 +45,14 @@ public abstract class SongodaPlugin extends JavaPlugin { public abstract List getExtraConfig(); @Override - public ConfigFileConfigurationAdapter getConfig() { - // todo? change prototype to FileConfiguration? This seems to cause development issues due to shading. + public FileConfiguration getConfig() { return config.getFileConfig(); } + public Config getCoreConfig() { + return config; + } + @Override public void reloadConfig​() { config.load(); diff --git a/Core/src/main/java/com/songoda/core/configuration/editor/PluginConfigGui.java b/Core/src/main/java/com/songoda/core/configuration/editor/PluginConfigGui.java index b980cb38..944fb13d 100644 --- a/Core/src/main/java/com/songoda/core/configuration/editor/PluginConfigGui.java +++ b/Core/src/main/java/com/songoda/core/configuration/editor/PluginConfigGui.java @@ -36,7 +36,7 @@ public class PluginConfigGui extends SimplePagedGui { this.plugin = plugin; // collect list of plugins - configs.put(plugin.getConfig().getCoreConfig().getFile().getName(), plugin.getConfig().getCoreConfig()); + configs.put(plugin.getCoreConfig().getFile().getName(), plugin.getCoreConfig()); List more = plugin.getExtraConfig(); if (more != null && !more.isEmpty()) { for (Config cfg : more) {