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

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

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

Configuration.removeCategory介绍

暂无

代码示例

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

configurartion.removeCategory( c );

代码示例来源:origin: CoFH/CoFHCore

public boolean removeCategory(String category) {
  if (!modConfiguration.hasCategory(category)) {
    return false;
  }
  modConfiguration.removeCategory(modConfiguration.getCategory(category));
  return true;
}

代码示例来源: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;
  }
}

相关文章