mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-30 14:03:23 +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.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,11 +45,14 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
|||||||
public abstract List<Config> getExtraConfig();
|
public abstract List<Config> getExtraConfig();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ConfigFileConfigurationAdapter getConfig() {
|
public FileConfiguration getConfig() {
|
||||||
// todo? change prototype to FileConfiguration? This seems to cause development issues due to shading.
|
|
||||||
return config.getFileConfig();
|
return config.getFileConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Config getCoreConfig() {
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reloadConfig() {
|
public void reloadConfig() {
|
||||||
config.load();
|
config.load();
|
||||||
|
@ -36,7 +36,7 @@ public class PluginConfigGui extends SimplePagedGui {
|
|||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
|
||||||
// collect list of plugins
|
// 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();
|
List<Config> more = plugin.getExtraConfig();
|
||||||
if (more != null && !more.isEmpty()) {
|
if (more != null && !more.isEmpty()) {
|
||||||
for (Config cfg : more) {
|
for (Config cfg : more) {
|
||||||
|
Loading…
Reference in New Issue
Block a user