本文整理汇总了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.");
}
}
示例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();
}
示例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
}
示例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
}
示例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;
}
示例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);
}
}
示例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
}
示例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
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}