Hallo,
Ich möchte gerne für jeden Spieler eine Einstellungsdatei erstellen.
Ich bin schon soweit, dass diese erstellt wird und ich Einträge darin speichern kann.
Aber wie lese ich diese dann aus ??
Ich möchte gerne für jeden Spieler eine Einstellungsdatei erstellen.
Ich bin schon soweit, dass diese erstellt wird und ich Einträge darin speichern kann.
Aber wie lese ich diese dann aus ??
Java:
public static File getPlayerFile(UUID arg0) {
File file = new File("plugins/EventLocator/Players", arg0.toString() + ".yml");
file.setWritable(true);
return file;
}
public static YamlConfiguration getPlayerCfg(UUID arg0) {
YamlConfiguration playerscfg = YamlConfiguration.loadConfiguration(getPlayerFile(arg0));
return playerscfg;
}
public static void SetText(UUID arg0, String Name ,String Value) throws IOException {
YamlConfiguration config = YamlConfiguration.loadConfiguration(getPlayerFile(arg0));
config.set(Name, Value);
try {
config.save(getPlayerFile(arg0));
} catch (Exception e) {}
}
public static boolean existPlayerFile(UUID arg0) {
if(getPlayerFile(arg0).exists()) {
return true;
} else {
return false;
}
}