Exemple #1
0
 public void reload() {
   inventory.clear();
   minMap.clear();
   YamlConfiguration yaml = YamlConfiguration.loadConfiguration(yamlFile);
   for (File file : dir.listFiles()) {
     if (file.getName().endsWith(".ser")) {
       Integer i = Integer.parseInt(file.getName().substring(0, file.getName().indexOf('.')));
       inventory.put(i, (SerInventory) SerInventory.loadObject(file.getAbsolutePath()));
       if (yaml.contains("inv" + i)) {
         minMap.put(
             i, new Integer[] {yaml.getInt("inv" + i + ".min"), yaml.getInt("inv" + i + ".max")});
       }
     }
   }
 }