當前位置: 首頁>>代碼示例>>Java>>正文


Java ConfigCategory.setComment方法代碼示例

本文整理匯總了Java中net.minecraftforge.common.config.ConfigCategory.setComment方法的典型用法代碼示例。如果您正苦於以下問題:Java ConfigCategory.setComment方法的具體用法?Java ConfigCategory.setComment怎麽用?Java ConfigCategory.setComment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.common.config.ConfigCategory的用法示例。


在下文中一共展示了ConfigCategory.setComment方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: villageConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void villageConfiguration() {
	ConfigCategory cat_village = config.getCategory(CATEGORY_VILLAGE);
	cat_village.setComment("Here you can configure the village generation");
	loadFields(cat_village, VILLAGE.class);
	
	if (VILLAGE.village_minDist < 0) {
		LogHelper.error("VillageDensity: Invalid config: Minimal distance must be non-negative.");
		VILLAGE.village_gen_enabled = false;
	}
	if (VILLAGE.village_minDist >= VILLAGE.village_density) {
		LogHelper.error("VillageDensity: Invalid config: Minimal distance must be smaller than density.");
		VILLAGE.village_gen_enabled = false;
	}
	if (VILLAGE.village_size < 0) {
		VILLAGE.village_gen_enabled = false;
		LogHelper.error("VillageDensity: Invalid config: Size must be non-negative.");
	}		
}
 
開發者ID:DracoAnimus,項目名稱:Coding,代碼行數:19,代碼來源:Configs.java

示例2: startServerManager

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
private void startServerManager() {
	Property globalPermissions = config.get("comm", "globalPermissions", "");
	Property undefinedPermissions = config.get("comm", "undefinedReceivePermissions", "");
	servers = new EnderServerManager(globalPermissions.getString(), undefinedPermissions.getString());
	reloadServerFile();
	
	ConfigCategory serverC = config.getCategory("servers");
       serverC.setComment("List servers in S:name=ip form, see endernet-servers.json for more detailed config");
       for(String name: serverC.keySet()) {
           	if(servers.get(name) != null) continue;
               EnderServer es = new EnderServer(name, serverC.get(name).getString());
               servers.add(es);
       }
       
       saveServerFile();
}
 
開發者ID:asiekierka,項目名稱:endernet,代碼行數:17,代碼來源:EnderNet.java

示例3: balanceCategoryConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
private static void balanceCategoryConfiguration()
{
	ConfigCategory cat_balance = config.getCategory(CATEGORY_BALANCE);
	cat_balance.setComment("You can adjust these values to change the balancing of this mod");
	loadFields(cat_balance, CoreBalance.GEN.class);
	loadFields(cat_balance, CoreBalance.DINO_PROPERTIES.class);
	// TODO: Add more classes from BALANCE here when available
}
 
開發者ID:BubbleTrouble14,項目名稱:ARKCraft,代碼行數:9,代碼來源:CoreConfig.java

示例4: balanceCategoryConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
private static void balanceCategoryConfiguration()
{
	ConfigCategory cat_balance = config.getCategory(CATEGORY_BALANCE);
	cat_balance.setComment("You can adjust these values to change the balancing of this mod");
	loadFields(cat_balance, ModuleItemBalance.PLANTS.class);
	loadFields(cat_balance, ModuleItemBalance.PLAYER.class);
	loadFields(cat_balance, ModuleItemBalance.WEAPONS.class);
	loadFields(cat_balance, ModuleItemBalance.CROP_PLOT.class);
	loadFields(cat_balance, ModuleItemBalance.MORTAR_AND_PESTLE.class);
	loadFields(cat_balance, ModuleItemBalance.PLAYER_CRAFTING.class);
	loadFields(cat_balance, ModuleItemBalance.COMPOST_BIN.class);
	loadFields(cat_balance, ModuleItemBalance.EXPLOSIVE_DEVICE.class);
	// TODO: Add more classes from BALANCE here when available
}
 
開發者ID:BubbleTrouble14,項目名稱:ARKCraft,代碼行數:15,代碼來源:ModuleItemConfig.java

示例5: balanceConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void balanceConfiguration() {
		// Categories
		ConfigCategory cat_balance = config.getCategory(CATEGORY_BALANCE);
		cat_balance.setComment("You can adjust these values to change the balancing of this mod");
		loadFields(cat_balance, BALANCE.class);

		// This can only fix a problem for the game to be able to run, has no effect on what 
		// is in the configuration.
//		if (BALANCE.PLAYER_AS_SILVER_DRAGON_INITIALLY != true)
//			BALANCE.PLAYER_AS_SILVER_DRAGON_INITIALLY = true;
	}
 
開發者ID:DracoAnimus,項目名稱:Coding,代碼行數:12,代碼來源:Configs.java

示例6: addTreePopulation

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
private static void addTreePopulation(Map<TreeConfiguration, Population> populations, ConfigCategory parent) {
	ConfigCategory treePopulation = new ConfigCategory("treepopulation", parent);
	treePopulation.setComment("Contains population for each tree. Trees are specified by the name in the corresponding tree configuration file.");
	
	for(Map.Entry<TreeConfiguration, Population> entry : populations.entrySet()) {
		ConfigCategory treeCategory = new ConfigCategory(entry.getKey().getName(), treePopulation);
		
		Population population = entry.getValue();
		Property percentageChancePerTree = createProperty(Population.PercentageChancePerTreeConfigKey, population.getPercentageChancePerTree());
		Property treesPerChunk = createProperty(Population.TreesPerChunkConfigKey, population.getTreesPerChunk());
		
		addPropertiesToCategory(treeCategory, percentageChancePerTree, treesPerChunk);
	}
}
 
開發者ID:vidaj,項目名稱:BigTrees,代碼行數:15,代碼來源:KTreeCfgBiomes.java

示例7: balanceCategoryConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
private static void balanceCategoryConfiguration()
{
    ConfigCategory cat_balance = config.getCategory(CATEGORY_BALANCE);
    cat_balance.setComment("You can adjust these values to change the balancing of this mod");
    loadFields(cat_balance, ModuleItemBalance.PLANTS.class);
    loadFields(cat_balance, ModuleItemBalance.PLAYER.class);
    loadFields(cat_balance, ModuleItemBalance.WEAPONS.class);
    loadFields(cat_balance, ModuleItemBalance.CROP_PLOT.class);
    loadFields(cat_balance, ModuleItemBalance.MORTAR_AND_PESTLE.class);
    loadFields(cat_balance, ModuleItemBalance.PLAYER_CRAFTING.class);
    loadFields(cat_balance, ModuleItemBalance.COMPOST_BIN.class);
    loadFields(cat_balance, ModuleItemBalance.EXPLOSIVE_DEVICE.class);
    // TODO: Add more classes from BALANCE here when available
}
 
開發者ID:Archiving,項目名稱:ARKCraft-Code,代碼行數:15,代碼來源:ModuleItemConfig.java

示例8: balanceCategoryConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
private static void balanceCategoryConfiguration()
{
    ConfigCategory cat_balance = config.getCategory(CATEGORY_BALANCE);
    cat_balance.setComment("You can adjust these values to change the balancing of this mod");
    loadFields(cat_balance, CoreBalance.GEN.class);
    loadFields(cat_balance, CoreBalance.DINO_PROPERTIES.class);
    // TODO: Add more classes from BALANCE here when available
}
 
開發者ID:Archiving,項目名稱:ARKCraft-Code,代碼行數:9,代碼來源:CoreConfig.java

示例9: link

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public void link(Configuration config, String name, String langKeyPrefix) {
    String[] parts = StringUtils.split(name, '.');
    String catName = parts[0];
    String propName = parts[1];
    
    // set category language key and description
    String catLangKey = langKeyPrefix + "." + catName;
    String catDesc = WordUtils.wrap(I18n.format(catLangKey + ".tooltip"), 128);

    // configure category and add property
    ConfigCategory cat = config.getCategory(catName);
    cat.setLanguageKey(catLangKey);
    cat.setComment(catDesc);

    // set property language key and description
    String propLangKey = langKeyPrefix + "." + propName;
    String propDesc = WordUtils.wrap(I18n.format(propLangKey + ".tooltip"), 128);

    // create supplier so that later calls don't need all the variables above
    propSupplier = () -> {
        Property prop = config.get(catName, propName, getPropDefault(),
            propDesc, getPropType());
        prop.setLanguageKey(propLangKey);
        return prop;
    };
    
    // initialize prop
    getProp();
    
    // make sure the properties have an insertion order
    List<String> order = new ArrayList<>(cat.getPropertyOrder());
    order.add(name);
    cat.setPropertyOrder(order);
}
 
開發者ID:ata4,項目名稱:minema,代碼行數:35,代碼來源:ConfigValue.java

示例10: link

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public void link(Configuration config, String name, String langKeyPrefix) {
    String[] parts = StringUtils.split(name, '.');
    String catName = parts[0];
    String propName = parts[1];
    
    // set category language key and description
    String catLangKey = langKeyPrefix + "." + catName;
    String catDesc = WordUtils.wrap(I18n.format(catLangKey + ".tooltip"), 128);

    // configure category and add property
    ConfigCategory cat = config.getCategory(catName);
    cat.setLanguageKey(catLangKey);
    cat.setComment(catDesc);

    // set property language key and description
    String propLangKey = langKeyPrefix + "." + propName;
    String propDesc = WordUtils.wrap(I18n.format(propLangKey + ".tooltip"), 128);
    
    // make sure the properties have insertion order instead of being
    // randomly ordered
    List<String> order = new ArrayList<>(cat.getPropertyOrder());
    order.add(propName);

    // create supplier so that later calls don't need all the variables above
    propSupplier = () -> {
        Property prop = config.get(catName, propName, getPropDefault(),
            propDesc, getPropType());
        prop.setLanguageKey(propLangKey);
        return prop;
    };
    
    // initialize prop
    getProp();
    
    // update prop order
    cat.setPropertyOrder(order);
}
 
開發者ID:ata4,項目名稱:mineshot,代碼行數:38,代碼來源:ConfigValue.java

示例11: init

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void init(File file)
	{
		Configuration config = new Configuration(file);
		blackList = new ArrayList<String>();
		config.load();
		//============================Blocks and Items========================
		ConfigCategory modListings = config.getCategory("modids");
		modListings.setComment("Format is that each line contains a comma delimited list of mods.\n"
                            +   "When one mod in each group is crafted, the other mods in that group are mods."
							+ 	"Each mod group is on their own line.");

		Property blacklistP = config.get("ModIds", "blacklist", new String[] {});
		blacklistP.comment = "ModIds blacklisted - add each group on a separate line.\n"
							+ "Format is 'modid1,modid2,modid3...'\n\n"
                            + "Example:   S:blacklist < \n"
                            + "  Thaumcraft,BloodMagic,Witchery\n"
                            + "  ThermalExpansion,MinefactoryReloaded\n "
                            + " >\n";
		blackList.addAll(Arrays.asList(blacklistP.getStringList()));
        for(int i=0; i < blackList.size(); i++) {
            blackList.set(i, blackList.get(i).toLowerCase().trim());
        }

        //TODO - these features eventually
//		Property category2 = config.get("DisableItem", "disableItem", true);
//		category2.comment = "Choose true if you would like the output of a mods mod's recipe to be a special 'disabled item'.\n"
//							+"Enter false to simply have nothing appear instead. Default is true.";
//      useDisableItem = (category2.getBoolean());

//		Property category3 = config.get("Gameplay", "gameplay", false);
//		category2.comment = "Choose true if you would like the player's disabled mods to reset on death. Default is false."
//      resetOnDeath = (category3.getBoolean());
		
		config.save();
	}
 
開發者ID:gr8pefish,項目名稱:HardChoices,代碼行數:36,代碼來源:ConfigHandler.java

示例12: balanceLevelingConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void balanceLevelingConfiguration() {	
	ConfigCategory cat_balance_leveling = config.getCategory(CATEGORY_BALANCE_LEVELING);
	cat_balance_leveling.setComment("You can adjust these values to change the level up requirements");
	loadFields(cat_balance_leveling, BALANCE.LEVELING.class);
}
 
開發者ID:DracoAnimus,項目名稱:Coding,代碼行數:6,代碼來源:Configs.java

示例13: balanceWildDragonPropConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void balanceWildDragonPropConfiguration() {
	ConfigCategory cat_balance_mobprop = config.getCategory(CATEGORY_BALANCE_MOBPROP);
	cat_balance_mobprop.setComment("You can adjust the properties of the added mobs");
	loadFields(cat_balance_mobprop, BALANCE.MOBPROP.class);		
}
 
開發者ID:DracoAnimus,項目名稱:Coding,代碼行數:6,代碼來源:Configs.java

示例14: balanceMobpropConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void balanceMobpropConfiguration() {
	ConfigCategory cat_balance_wild_dragon_prop = config.getCategory(CATEGORY_BALANCE_WILD_FIRE_DRAGON_PROP);
	cat_balance_wild_dragon_prop.setComment("You can adjust the properties of the wild fire dragon");
	loadFields(cat_balance_wild_dragon_prop, BALANCE.WILD_FIRE_DRAGON_PROP.class);		
}
 
開發者ID:DracoAnimus,項目名稱:Coding,代碼行數:6,代碼來源:Configs.java

示例15: balanceChestItemsConfiguration

import net.minecraftforge.common.config.ConfigCategory; //導入方法依賴的package包/類
public static void balanceChestItemsConfiguration() {
	ConfigCategory cat_chest_items = config.getCategory(CATEGORY_CHEST_ITEMS);
	cat_chest_items.setComment("You can adjust the probability of items in village blacksmith chests");
	loadFields(cat_chest_items, BALANCE.CHEST_ITEMS.class);
}
 
開發者ID:DracoAnimus,項目名稱:Coding,代碼行數:6,代碼來源:Configs.java


注:本文中的net.minecraftforge.common.config.ConfigCategory.setComment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。