Exemple #1
0
 public Map<String, Dungeon> getDungeons() {
   Map<String, Dungeon> dungeons = new HashMap<>();
   File dungeonsDirectory = new File(plugin.getDataFolder(), "dungeons");
   for (File file : dungeonsDirectory.listFiles(new YamlFileFilter())) {
     Dungeon dungeon = new DungeonImpl(file);
     dungeons.put(file.getName().replace(".yml", ""), dungeon);
   }
   return dungeons;
 }
Exemple #2
0
 public void addDungeon(String name, Dungeon dungeon) {
   File dungeonsDirectory = new File(plugin.getDataFolder(), "dungeons");
   File dungeonFile = new File(dungeonsDirectory, name + ".yml");
   YamlConfiguration dungeonConfig = new YamlConfiguration();
   dungeonConfig.set("dungeon", dungeon);
   try {
     dungeonConfig.save(dungeonFile);
   } catch (IOException exception) {
     exception.printStackTrace();
   }
 }
Exemple #3
0
 public Dungeon getDungeon(String name) {
   File dungeonsDirectory = new File(plugin.getDataFolder(), "dungeons");
   File dungeonFile = new File(dungeonsDirectory, name + ".yml");
   return new DungeonImpl(dungeonFile);
 }