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

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

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

Configuration.setCategoryComment介绍

暂无

代码示例

代码示例来源:origin: Ellpeck/ActuallyAdditions

private static List<IConfigElement> getConfigElements(){
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    for(int i = 0; i < ConfigCategories.values().length; i++){
      ConfigCategories cat = ConfigCategories.values()[i];
      ConfigurationHandler.config.setCategoryComment(cat.name, cat.comment);
      list.add(new ConfigElement(ConfigurationHandler.config.getCategory(cat.name)));
    }
    return list;
  }
}

代码示例来源:origin: portablejim/VeinMiner

@SuppressWarnings("UnusedDeclaration")
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
  File configDir = new File(event.getModConfigurationDirectory(), "veinminer");
  File loadedFile = new File(configDir, "modSupport.cfg");
  try {
    Configuration config = new Configuration(loadedFile);
    config.load();
    config.addCustomCategoryComment(CONFIG_AUTODETECT, CONFIG_AUTODETECT_COMMENT);
    AUTODETECT_TOOLS_TOGGLE = config.get(CONFIG_AUTODETECT, AUTODETECT_TOOLS_TOGGLE_CONFIGNAME, AUTODETECT_TOOLS_TOGGLE_DEFAULT, AUTODETECT_TOOLS_TOGGLE_DESCRIPTION).getBoolean(AUTODETECT_TOOLS_TOGGLE_DEFAULT);
    config.setCategoryComment("advanced", "You probably don't want to touch these");
    String[] badTools_array = config.getStringList("bad_tools", "advanced", BADTOOLS_DEFAULT, "Tools that break veinminer.");
    String[] falseTools_array = config.getStringList("special_snowflake_tools", "advanced", FALSETOOLS_DEFAULT, "Tools that need to be treated as special snowflakes\n");
    String[] overrideBlacklist_array = config.getStringList("override_blacklist_blocks", "advanced", OVERRIDE_BLACKLIST_DEFAULT, "Blocks to not override success for\n");
    falseTools = new LinkedHashSet<String>(Arrays.asList(falseTools_array));
    overrideBlacklist = new LinkedHashSet<String>(Arrays.asList(overrideBlacklist_array));
    badTools = new LinkedHashSet<String>(Arrays.asList(badTools_array));
    config.save();
  }
  catch(Exception e) {
    event.getModLog().error("Error writing config file");
  }
}

代码示例来源:origin: MatrexsVigil/harvestcraft

private void ConfigureCommon() {
  availableBiomes = ForgeRegistries.BIOMES.getValues();
  StringBuilder biomeNames = new StringBuilder();
  biomeNames.append("Available/Detected biomes: ");
  for (Biome x : this.availableBiomes) {
    biomeNames.append("[" + x.getRegistryName().toString() + "], ");
    HarvestCraft.log.info(
        x.getRegistryName().toString() + ";" +
            x.getTempCategory() + ";" +
            //x.getFloatTemperature(new BlockPos(0,0,0)) + ";" +
            x.getTemperature(new BlockPos(0,0,0)) + ";" +
                        x.isHighHumidity() + ";" +
            x.isMutation() + ";" +
            x.isSnowyBiome() + ";" +
            BiomeDictionary.getTypes(x).toString()
    );
  }
  this.config.setCategoryComment(CATEGORY_FRUIT_TREES_COMMON, biomeNames.toString());
  this.enableFruitTreeGeneration = config.get(CATEGORY_FRUIT_TREES_COMMON, "enableFruitTreeGeneration", true, "Default: true").getBoolean();
  this.fruitGrowthSpeed = config.get(CATEGORY_FRUIT_TREES_COMMON, "fruitGrowthSpeed", 25, "Default: 25, Lower is faster").getInt();
}

代码示例来源:origin: Darkhax-Minecraft/Bookshelf

private void syncConfigData () {
    
    final String category = "oredict";
    config.setCategoryComment(category, "WARNIG: Changing these config options may break recipes in mods that use Bookshelf.");
    oreDictMisc = config.getBoolean("misc", category, true, "Should misc blocks like magma blocks and bone blocks be put in the ore dict?");
    oreDictFence = config.getBoolean("fence", category, true, "Should vanilla fences and fence gates be ore dicted?");
    oreDictShulker = config.getBoolean("shulker", category, true, "Should vanilla shulker boxes be ore dicted?");
    oreDictSeeds = config.getBoolean("seeds", category, true, "Should vanilla seeds be ore dicted?");
    oreDictRails = config.getBoolean("rails", category, true, "Should vanilla rails be ore dicted?");
    oreDictArrows = config.getBoolean("arrows", category, true, "Should vanilla arrows be ore dicted?");
    
    final String category1 = "translations";
    config.setCategoryComment(category1, "Adds support for additional levels. Lowering this can improve memory.");
    translateEnchantmentCount = config.getInt("enchantmentCount", category1, 256, 0, Short.MAX_VALUE, "The amount of enchantment levels to translate. 10 or less will disable this.");
    
    if (config.hasChanged()) {
      config.save();
    }
  }
}

代码示例来源:origin: PrinceOfAmber/Cyclic

@Override
 public void syncConfig(Configuration config) {
  category = Const.ConfigCategory.commands;
  config.setCategoryComment(category, "Disable any command that was added");
  syncCommandConfig(config, CommandNbtSet.name, true, "Debug command to set values on items, currently only sets strings");
  syncCommandConfig(config, CommandNbt.name, false, "Read NBT data from your held item");
  syncCommandConfig(config, CommandEnderChest.name, true, "Opens your ender chest");
  syncCommandConfig(config, CommandGetHome.name, false, "Get where your current spawn is set (by a bed)");
  syncCommandConfig(config, CommandHeal.name, true, "Heal yourself (or a target player) to full");
  syncCommandConfig(config, CommandHearts.name, true, "Increase the maximum hearts of a target player (lasts until death)");
  syncCommandConfig(config, CommandHome.name, true, "Teleport you to your current spawn (if its set)");
  syncCommandConfig(config, CommandPing.name, false, "Display your current coordinates");
  syncCommandConfig(config, CommandSearchItem.name, false, "Search for an item in nearby containers");
  syncCommandConfig(config, CommandSearchSpawner.name, true, "Search the world nearby for spawners (dungeons, etc)");
  syncCommandConfig(config, CommandSearchTrades.name, false, "Search nearby villagers for trades based on item names");
  syncCommandConfig(config, CommandTodoList.name, false, "Set reminders on screen for yourself");
  syncCommandConfig(config, CommandVillageInfo.name, false, "Get the stats on the nearest village (if any)");
  syncCommandConfig(config, CommandWorldHome.name, true, "Teleport to true worldspawn");
 }
}

代码示例来源:origin: PrinceOfAmber/Cyclic

@Override
public void syncConfig(Configuration config) {
 String category = Const.ConfigCategory.recipes;
 config.setCategoryComment(category, "New and altered recipes");
 playerSkull = config.get(category, "Player Skulls",
   true, "Create a player skull by combining wither, skeleton, zombie, and creeper skulls").getBoolean();
 simpleDispenser = config.get(category, "Simple Dispenser",
   true, "Craft a dispenser with string instead of a bow").getBoolean();
 repeaterSimple = config.get(category, "Simple Repeater",
   true, "Craft repeaters using sticks and redstone in place of redstone torches").getBoolean();
 minecartsSimple = config.get(category, "Simple Minecarts",
   true, "Craft the minecart combinations using five iron as well as minecarts").getBoolean();
 notchApple = config.get(category, "Notch Apple",
   true, "Craft a notch apple with golden blocks as usual").getBoolean();
 melonToSlice = config.get(category, "Melon Block Slices",
   true, "Craft a Melon block into nine slices").getBoolean();
 category = Const.ConfigCategory.recipes;
 snowBlocksToBalls = config.get(category, "SnowBlockBalls",
   true, "Craft Snow blocks back into snowballs").getBoolean();
 quartzBlocksToItem = config.get(category, "QuartzBlockToItem",
   true, "Craft Quartz blocks back to the items").getBoolean();
 glowstoneBlockToDust = config.get(category, "GlowstoneBlockToDust",
   true, "Craft Glowstone blocks back to dust").getBoolean();
 netherwartBlockReverse = config.get(category, "NetherwartBlockReverse",
   true, "Craft Netherwart blocks back to item").getBoolean();
}

代码示例来源:origin: PrinceOfAmber/Cyclic

@Override
public void syncConfig(Configuration config) {
 String category = Const.ConfigCategory.worldGen;
 config.setCategoryComment(category, "Control any blocks that get generated in new chunks & new worlds");
 Property prop;
 prop = config.get(category, "Nether Ore", true, "Generate ore in the nether.");

相关文章