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

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

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

Configuration.hasCategory介绍

暂无

代码示例

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

public boolean hasCategory(String category) {
  return modConfiguration.hasCategory(category);
}

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

if( !configurartion.hasCategory( CONFIG_COMMON_KEY ) )
if( !configurartion.hasCategory( CONFIG_FACADES_KEY ) )

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

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

代码示例来源:origin: Vazkii/Quark

void addFeatureButtons() {
  int startX = width / 2 - 195;
  int startY = height / 6 + 20;
  
  buttonList.removeIf((b) -> b instanceof GuiButtonConfigSetting || b instanceof GuiButtonFeatureSettings);
  
  int x = 0, y = 0;
  
  int start = page * FEATURES_PER_PAGE;
  for(int i = start; i < Math.min(start + FEATURES_PER_PAGE, features.size()); i++) {
    int j = i - start;
    x = startX + j % 2 * 200;
    y = startY + j / 2 * 22;
    
    Feature feature = features.get(i);
    
    buttonList.add(new GuiButtonConfigSetting(x + 150, y, feature.prop, true, feature.getFeatureIngameConfigName()));
    
    if(ModuleLoader.config.hasCategory(feature.configCategory))
      buttonList.add(new GuiButtonFeatureSettings(x + 170, y, feature.configCategory));
  }
  
  if(left != null) {
    left.enabled = (page > 0);
    right.enabled = (page < totalPages - 1);
  }
}

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

public static boolean playerHasAccess(String playerName, GameProfile owner) {
  if (owner == null || playerName == null) {
    return false;
  }
  if (playerName.equals(owner.getName())) {
    return true;
  }
  String id = owner.getId().toString();
  return (friendConf.hasCategory(id) && friendConf.getCategory(id).containsKey(playerName.toLowerCase(Locale.US)));
}

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

public synchronized static boolean removeFriend(GameProfile owner, String friendName) {
  if (owner == null || friendName == null) {
    return false;
  }
  String id = owner.getId().toString();
  friendName = friendName.toLowerCase(Locale.US);
  if (friendConf.hasCategory(id)) {
    if (friendConf.getCategory(id).containsKey(friendName)) {
      friendConf.getCategory(id).remove(friendName);
      friendConf.save();
      return true;
    }
  }
  return false;
}

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

public boolean renameCategory(String category, String newCategory) {
  if (!modConfiguration.hasCategory(category)) {
    return false;
  }
  modConfiguration.getCategory(category);
  for (Property prop : modConfiguration.getCategory(category).values()) {
    copyProperty(category, prop.getName(), newCategory, prop.getName(), true);
  }
  removeCategory(category);
  return true;
}

代码示例来源:origin: FTBTeam/FTB-Utilities

public void preInit()
{
  FTBUtilitiesConfig.sync();
  if (FTBUtilitiesConfig.ranks.enabled)
  {
    PermissionAPI.setPermissionHandler(FTBUtilitiesPermissionHandler.INSTANCE);
  }
  FTBUtilitiesNetHandler.init();
  if (!ForgeChunkManager.getConfig().hasCategory(FTBUtilities.MOD_ID))
  {
    ForgeChunkManager.getConfig().get(FTBUtilities.MOD_ID, "maximumChunksPerTicket", 1000000).setMinValue(0);
    ForgeChunkManager.getConfig().get(FTBUtilities.MOD_ID, "maximumTicketCount", 1000000).setMinValue(0);
    ForgeChunkManager.getConfig().save();
  }
  ForgeChunkManager.setForcedChunkLoadingCallback(FTBUtilities.INST, FTBUtilitiesLoadedChunkManager.INSTANCE);
  new CustomPermissionPrefixesRegistryEvent(CUSTOM_PERM_PREFIX_REGISTRY::add).post();
}

代码示例来源:origin: RS485/LogisticsPipes

Configs.loaded = true;
if (Configs.CONFIGURATION.hasCategory("logisticspipe.id")
    || Configs.CONFIGURATION.hasCategory("logisticsPipe.id")) {
  throw new RuntimeException(
      "Old config, please remove it and manually reconfigure LogisticPipes");

相关文章