add list of plugins to load to config

This commit is contained in:
asofold 2012-06-24 03:10:06 +02:00
parent f316dc8379
commit 078072f043

View File

@ -1,8 +1,7 @@
package me.asofold.bukkit.cncp.setttings;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import me.asofold.bukkit.cncp.config.compatlayer.CompatConfig;
@ -11,13 +10,12 @@ import me.asofold.bukkit.cncp.config.compatlayer.NewConfig;
public class Settings {
public Set<String> forceEnableLater = new HashSet<String>();
public Set<String> loadPlugins = new HashSet<String>();
public static CompatConfig getDefaultConfig(){
CompatConfig cfg = new NewConfig(null);
List<String> tempList = new LinkedList<String>();
tempList.add("NoCheatPlus");
cfg.set("plugins.force-enable-later", tempList);
cfg.set("plugins.force-enable-later", Arrays.asList(new String[]{ "NoCheatPlus" }));
cfg.set("plugins.load", Arrays.asList(new String[]{ "WorldGuard" }));
return cfg;
}
@ -28,6 +26,7 @@ public class Settings {
public boolean fromConfig(CompatConfig cfg){
// plugins to force enabling after this plugin.
ConfigUtil.readStringSetFromList(cfg, "plugins.force-enable-later", forceEnableLater, true, true, false);
ConfigUtil.readStringSetFromList(cfg, "plugins.load", loadPlugins, true, true, false);
return true;
}