本文整理了Java中net.minecraftforge.common.config.Configuration.getLoadedConfigVersion()
方法的一些代码示例,展示了Configuration.getLoadedConfigVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getLoadedConfigVersion()
方法的具体详情如下:
包路径:net.minecraftforge.common.config.Configuration
类名称: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());
内容来源于网络,如有侵权,请联系作者删除!