net.minecraftforge.common.config.Configuration.getLoadedConfigVersion()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中net.minecraftforge.common.config.Configuration.getLoadedConfigVersion()方法的一些代码示例,展示了Configuration.getLoadedConfigVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getLoadedConfigVersion()方法的具体详情如下:
包路径:net.minecraftforge.common.config.Configuration
类名称:Configuration
方法名:getLoadedConfigVersion

Configuration.getLoadedConfigVersion介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

private static Configuration migrate( Configuration configurartion )
  if( configurartion.getLoadedConfigVersion() == null )

代码示例来源:origin: MightyPirates/TIS-3D

private static void upgradeConfig(final Configuration config) {
  final String loadedVersion = config.getLoadedConfigVersion();
  int loadedVersionInt;
  try {
    loadedVersionInt = Integer.parseInt(loadedVersion);
  } catch (final NumberFormatException e) {
    loadedVersionInt = 0;
  }
  // Incremental upgrade logic: fall through starting at old version.
  switch (loadedVersionInt) {
    case 0:
      config.get(CATEGORY_MODULE_EXECUTION, NAME_MAX_LINES_PER_PROGRAM, maxLinesPerProgram,
        COMMENT_MAX_LINES_PER_PROGRAM, 1, 200).set(40);
      for (final String module : Constants.MODULES) {
        final String moduleName = module.substring("module_".length());
        final String oldModuleName = moduleName.replace("_", "");
        config.removeCategory(config.getCategory(CATEGORY_MODULE + "._" + moduleName));
        config.removeCategory(config.getCategory(CATEGORY_MODULE + "." + oldModuleName));
      }
    default:
      break;
  }
}

代码示例来源:origin: TeamLapen/Vampirism

disable_halloween_special = main_config.getBoolean("disable_halloween_special", CATEGORY_DISABLE, false, "Disable halloween special event");
updated_vampirism = !main_config.getDefinedConfigVersion().equals(main_config.getLoadedConfigVersion());

相关文章