Beispiel #1
0
 public void saveTo(ConfigurationSection warConfigSection) {
   for (WarConfig config : WarConfig.values()) {
     if (this.bag.containsKey(config)) {
       warConfigSection.set(config.toString(), this.bag.get(config));
     }
   }
 }
Beispiel #2
0
 public void loadFrom(ConfigurationSection warConfigSection) {
   for (WarConfig config : WarConfig.values()) {
     if (warConfigSection.contains(config.toString())) {
       if (config.getConfigType().equals(Integer.class)) {
         this.put(config, warConfigSection.getInt(config.toString()));
       } else if (config.getConfigType().equals(Boolean.class)) {
         this.put(config, warConfigSection.getBoolean(config.toString()));
       }
     }
   }
 }