コード例 #1
0
 public void saveToConfig() {
   Config.getGamesConfig().set("games." + getKey() + ".enabled", enabled);
   Config.getGamesConfig().set("games." + getKey() + ".name", name);
   Config.getGamesConfig().set("games." + getKey() + ".type", type.getKey());
   Config.getGamesConfig().set("games." + getKey() + ".plays", playCount);
   Config.saveConfigs();
 }
コード例 #2
0
  // Config file methods //
  public boolean loadFromConfig(String key) {
    if (!Config.getGamesConfig().contains("games." + key)) return false;

    enabled = Config.getGamesConfig().getBoolean("games." + key + ".enabled", true);
    name = Config.getGamesConfig().getString("games." + key + ".name");
    type = Main.getGameTypes().get(Config.getGamesConfig().getString("games." + key + ".type"));
    playCount = Config.getGamesConfig().getInt("games." + key + ".plays");
    return true;
  }