mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-27 12:35:12 +01:00
change getConfig to be easier to use in external API
This commit is contained in:
parent
d6847ec4f5
commit
a5dd9b74a9
@ -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<Config> 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();
|
||||
|
@ -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<Config> more = plugin.getExtraConfig();
|
||||
if (more != null && !more.isEmpty()) {
|
||||
for (Config cfg : more) {
|
||||
|
Loading…
Reference in New Issue
Block a user