本文整理了Java中net.minecraftforge.common.config.Configuration.addCustomCategoryComment()
方法的一些代码示例,展示了Configuration.addCustomCategoryComment()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.addCustomCategoryComment()
方法的具体详情如下:
包路径:net.minecraftforge.common.config.Configuration
类名称:Configuration
方法名:addCustomCategoryComment
暂无
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void initializeCategories() {
config.addCustomCategoryComment(generalOptions, "General Options\n" + "Affect both client and server. These configs must match for client and server, or\n" + "strange and probably BAD things WILL happen.");
config.addCustomCategoryComment(serverOptions, "Server Options\n" + "Affect only server-side operations. Will need to be set for dedicated servers, and single\n" + "player (or LAN worlds). Clients playing on remote servers can ignore these settings.");
config.addCustomCategoryComment(clientOptions, "Client Options\n" + "Affect only client-side operations. Many of these options can be set from the in-game Options GUI.\n" + "Server admins can ignore these settings.");
config.addCustomCategoryComment(worldGenSettings, "AW Core World Generation Settings\n" + "Server-side only settings. These settings affect world generation settings for AWCore.");
config.addCustomCategoryComment(researchSettings, "Research Settings Section\n" + "Affect both client and server. These configs must match for client and server, or\n" + "strange and probably BAD things WILL happen.");
config.addCustomCategoryComment(recipeDetailSettings, "Recipe Detail Settings Section\n" + "Configure recipe enable/disable per item.\n" + "Disabling the recipe effectively disables that item.\n" + "Affect both client and server. These configs must match for client and server, or\n" + "strange and probably BAD things WILL happen.");
config.addCustomCategoryComment(recipeResearchDetails, "Recipe Research Detail Settings Section\n" + "Configure enable/disable research for specific recipes.\n" + "Disabling the research removes all research requirements for that item.\n" + "Affect both client and server. These configs must match for client and server, or\n" + "strange and probably BAD things WILL happen.");
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void initializeCategories() {
config.addCustomCategoryComment(generalOptions, "General Options\n" + "Affect both client and server.\nThese configs must match for client and server, or strange and probably BAD things WILL happen.");
config.addCustomCategoryComment(serverOptions, "Server Options\n" + "Affect only server-side operations.\nWill need to be set for dedicated servers, and single player (or LAN worlds).\nClients playing on remote servers can ignore these settings.");
config.addCustomCategoryComment(clientOptions, "Client Options\n" + "Affect only client-side operations.\nMany of these options can be set from the in-game Options GUI.\n" + "Server admins can ignore these settings.");
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void initializeCategories() {
this.config.addCustomCategoryComment(worldGenCategory, "Settings that effect all world-structure-generation.");
this.config.addCustomCategoryComment(villageGenCategory, "Settings that effect the generation of vanilla villages.\nCurrently there are no village-generation options, and no structures will generate in villages.");
this.config.addCustomCategoryComment(excludedEntitiesCategory, "Entities that will not show up in the Mob Spawner Placer entity selection list.\nAdd any mobs here that will crash if spawned via the vanilla mob-spawner (usually complex NBT-defined entities).");
this.config.addCustomCategoryComment(worldGenBlocks, "Blocks that should be skipped/ignored during world gen -- should list all plant blocks/logs/foliage");
this.config.addCustomCategoryComment(targetBlocks, "List of target blocks that structures and towns can spawn on in addition to materials that are automatically whitelisted.");
this.config.addCustomCategoryComment(scanSkippedBlocks, "List of blocks that the structure scanner will completely ignore.\nWhenever these blocks are encountered the template will instead fill that block position with a hard-air rule.\nAdd any blocks to this list that may cause crashes when scanned or duplicated.\nVanilla blocks should not need to be added, but some mod-blocks may.\nBlock names must be specified by fully-qualified name (e.g. \"minecraft:chests/stronghold_corridor\")");
this.config.addCustomCategoryComment(excludedLootTables, "List of loot tables that should be excluded from loot chest placer GUI.\nLoot table names must be specified by fully-qualified name (e.g. \"minecraft:stone\")");
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void initializeCategories() {
config.addCustomCategoryComment(generalOptions, "General Options\n" + "Affect both client and server. These configs must match for client and server, or\n" + "strange and probably BAD things WILL happen.");
config.addCustomCategoryComment(serverOptions, "Server Options\n" + "Affect only server-side operations. Will need to be set for dedicated servers, and single\n" + "player (or LAN worlds). Clients playing on remote servers can ignore these settings.");
config.addCustomCategoryComment(clientOptions, "Client Options\n" + "Affect only client-side operations. Many of these options can be set from the in-game Options GUI.\n" + "Server admins can ignore these settings.");
foodConfig = getConfigFor("AncientWarfareNpcFood");
foodConfig.addCustomCategoryComment(foodSettings, "Food Value Options\n" + "The value specified is the number of ticks that the item will feed the NPC for.\n" + "Add a new line for each item. The item type is not checked, and the default multiplier is not applied.\n" + "0 or under will make the item unusable as a food.\n" + "Affect only server-side operations. Will need to be set for dedicated servers, and single\n" + "player (or LAN worlds). Clients playing on remote servers can ignore these settings.");
factionConfig = getConfigFor("AncientWarfareNpcFactionStandings");
factionConfig.addCustomCategoryComment(factionSettings, "Faction Options\n" + "Set starting faction values, and alter the amount of standing gained/lost from player actions.\n" + "Affect only server-side operations. Will need to be set for dedicated servers, and single\n" + "player (or LAN worlds). Clients playing on remote servers can ignore these settings.");
}
代码示例来源:origin: McJtyMods/ModTutorials
private static void initDimensionConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_DIMENSIONS, "Dimension configuration");
dimensionId = cfg.getInt("dimensionId", CATEGORY_DIMENSIONS, dimensionId, -1000, 1000, "The Id to use for the dimension");
}
}
代码示例来源:origin: SonOfTheStars/Logistics-Pipes-2
/**
* Provide Values of General Category
* @param cfg Config Provider
*/
private static void initGeneral(Configuration cfg){
cfg.addCustomCategoryComment(CAT_GENERAL, "General settings:");
allowTierTwo = cfg.getBoolean("allowT2", CAT_GENERAL, true, "Wether or not to allow the Crafting of Industrial Grade Pipes.");
}
代码示例来源:origin: PrinceOfAmber/Cyclic
@Override
public void syncConfig(Configuration config) {
String category = Const.ConfigCategory.blocks;
config.addCustomCategoryComment(category, "Tweaks to new and existing blocks");
fragileTorches = config.getBoolean("Fragile Torches", category, false,
"Torches can get knocked over when passed through by living entities");
}
}
代码示例来源:origin: McJtyMods/ModTutorials
private static void initGeneralConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "General configuration");
isThisAGoodTutorial = cfg.getBoolean("goodTutorial", CATEGORY_GENERAL, isThisAGoodTutorial, "Set to false if you don't like this tutorial");
yourRealName = cfg.getString("realName", CATEGORY_GENERAL, yourRealName, "Set your real name here");
}
代码示例来源:origin: WayofTime/BloodMagic
public void syncConfig() {
config.addCustomCategoryComment("rituals", "Toggles for all rituals");
rituals.forEach((k, v) -> config.getBoolean(k, "rituals", true, "Enable the " + k + " ritual."));
imperfectRituals.forEach((k, v) -> config.getBoolean(k, "rituals.imperfect", true, "Enable the " + k + " imperfect ritual."));
config.save();
}
代码示例来源:origin: SonOfTheStars/Logistics-Pipes-2
/**
* Provides Values of Network Category
* @param cfg Config Provider
*/
private static void initNetwork(Configuration cfg){
cfg.addCustomCategoryComment(CAT_NETWORK, "Network specific settings:");
baseNetCost = cfg.getFloat("baseNetworkCost", CAT_NETWORK, 30.0f, 5.0f, 10000.0f, "The Base energy consumption of the Network Core");
routedIdleCost = cfg.getFloat("routedIdleCost", CAT_NETWORK, 4.0f, 1.0f, 100.0f, "The idle power consumption of a Routed Pipe in a Network, between 1 and 100 RF/t");
}
代码示例来源:origin: PrinceOfAmber/Cyclic
@Override
public void syncConfig(Configuration c) {
String category = Const.ConfigCategory.villagers;
c.addCustomCategoryComment(category, "Two new villagers with more trades");
sageEnabled = c.getBoolean("SageVillagers", category, true, "Adds new villager type Sage. Spawns naturally and from mob eggs. ");
druidEnabled = c.getBoolean("DruidVillagers", category, true, "Adds new villager type Druid. Spawns naturally and from mob eggs. ");
}
}
代码示例来源:origin: McJtyMods/TheOneProbe
private void readMainConfig() {
Configuration cfg = TheOneProbe.config;
try {
cfg.load();
cfg.addCustomCategoryComment(Config.CATEGORY_THEONEPROBE, "The One Probe configuration");
cfg.addCustomCategoryComment(Config.CATEGORY_PROVIDERS, "Provider configuration");
cfg.addCustomCategoryComment(Config.CATEGORY_CLIENT, "Client-side settings");
Config.init(cfg);
} catch (Exception e1) {
TheOneProbe.logger.log(Level.ERROR, "Problem loading config file!", e1);
} finally {
if (TheOneProbe.config.hasChanged()) {
TheOneProbe.config.save();
}
}
}
代码示例来源:origin: elucent/Albedo
public static void load(){
config.addCustomCategoryComment("light", "Settings related to lighting.");
config.addCustomCategoryComment("misc", "Settings related to random effects.");
maxLights = config.getInt("maxLights", "light", 10, 0, 100, "The maximum number of lights allowed to render in a scene. Lights are sorted nearest-first, so further-away lights will be culled after nearer lights.");
enableLights = config.getBoolean("enableLights", "light", true, "Enables lighting in general.");
eightBitNightmare = config.getBoolean("eightBitNightmare", "misc", false, "Enables retro mode.");
if (config.hasChanged())
{
config.save();
}
}
代码示例来源:origin: PrinceOfAmber/Cyclic
@Override
public void syncConfig(Configuration config) {
String category = Const.ConfigCategory.mobs;
config.addCustomCategoryComment(category, "Changes to vanilla mobs");
nameTagDeath = config.getBoolean("Name Tag Death", category, true,
"When an entity dies that is named with a tag, it drops the nametag");
endermanDrop = config.getBoolean("Enderman Block", category, true,
"Enderman will always drop block they are carrying 100%");
endermanPickupBlocks = config.getBoolean("Enderman Pickup Blocker", category, true,
"False is the same as vanilla behavior. True means that this mod will block enderman from picking up all registered blocks (does not listen to mob actions, this scans registry only once on startup and sets properties). ");
}
代码示例来源:origin: PrinceOfAmber/Cyclic
@Override
public void syncConfig(Configuration config) {
spawnDistanceEnabled = config.getBoolean("F3SpawnChunkInfo", Const.ConfigCategory.player, true, "Show Within Spawn Chunks or Distance from Spawn in F3 screen.");
horseInfoEnabled = config.getBoolean("F3HorseInfo", Const.ConfigCategory.player, true, "Show Speed and jump height of any horse you are riding in F3.");
String category = Const.ConfigCategory.items;
config.addCustomCategoryComment(category, "Tweaks to new and existing items");
foodDetails = config.getBoolean("Food Details", category, true, "Add food value and saturation to items info (hold shift)");
fuelDetails = config.getBoolean("Fuel Details", category, true, "Add fuel burn time to items info (hold shift)");
}
}
代码示例来源:origin: ForestryMC/Binnie
@Override
public void configure(Configuration config) {
canQuarryMineHives = config.getBoolean("canQuarryMineHives", Configuration.CATEGORY_GENERAL, true, "Sets whether a quarry will be able to mine hives or not.");
config.addCustomCategoryComment(WORLDGEN, "WorldGen settings for ExtraBees");
waterHiveRate = config.getInt("waterHiveRate", WORLDGEN, 2, 0, 10, "Sets the worldgen spawn chance for water hives.");
rockHiveRate = config.getInt("rockHiveRate", WORLDGEN, 2, 0, 10, "Sets the worldgen spawn chance for rock hives.");
netherHiveRate = config.getInt("netherHiveRate", WORLDGEN, 2, 0, 10, "Sets the worldgen spawn chance for nether hives.");
marbleHiveRate = config.getInt("marbleHiveRate", WORLDGEN, 2, 0, 10, "Sets the worldgen spawn chance for marble hives.");
}
}
代码示例来源:origin: McJtyMods/XNet
private void readMainConfig() {
Configuration cfg = mainConfig;
try {
cfg.load();
cfg.addCustomCategoryComment(GeneralConfiguration.CATEGORY_GENERAL, "General settings");
GeneralConfiguration.init(cfg);
} catch (Exception e1) {
FMLLog.log(Level.ERROR, e1, "Problem loading config file!");
} finally {
if (mainConfig.hasChanged()) {
mainConfig.save();
}
}
}
代码示例来源:origin: McJtyMods/RFToolsControl
private void readMainConfig() {
Configuration cfg = mainConfig;
try {
cfg.load();
cfg.addCustomCategoryComment(GeneralConfiguration.CATEGORY_GENERAL, "General settings");
GeneralConfiguration.init(cfg);
} catch (Exception e1) {
FMLLog.log(Level.ERROR, e1, "Problem loading config file!");
} finally {
if (mainConfig.hasChanged()) {
mainConfig.save();
}
}
}
代码示例来源:origin: Direwolf20-MC/BuildingGadgets
private static void initGeneralConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "General configuration");
// cfg.getBoolean() will get the value in the config if it is already specified there. If not it will create the value.
maxRange = cfg.getInt("maxRange", CATEGORY_GENERAL, maxRange, 1, 25, "The max range of the building tool");
energyCostBuilder = cfg.getInt("energyCostBuilder", CATEGORY_GENERAL, energyCostBuilder, 0, 100000, "The energy cost of the Builder per block");
energyCostExchanger = cfg.getInt("energyCostExchanger", CATEGORY_GENERAL, energyCostExchanger, 0, 100000, "The energy cost of the Exchanger per block");
energyCostDestruction = cfg.getInt("energyCostDestruction", CATEGORY_GENERAL, energyCostDestruction, 0, 100000, "The energy cost of the Destruction Gadget per block");
energyMax = cfg.getInt("energyMax", CATEGORY_GENERAL, energyMax, 0, Integer.MAX_VALUE, "The max energy of the Builder & Exchanger");
energyMaxDestruction = cfg.getInt("energyMaxDestruction", CATEGORY_GENERAL, energyMaxDestruction, 0, Integer.MAX_VALUE, "The max energy of the Destruction Gadget");
poweredByFE = cfg.getBoolean("poweredByFE", CATEGORY_GENERAL, poweredByFE, "Set to true for Forge Energy Support, set to False for vanilla Item Damage");
durabilityBuilder = cfg.getInt("durabilityBuilder", CATEGORY_GENERAL, durabilityBuilder, 0, 100000, "The max durability of the Builder (Ignored if powered by FE)");
durabilityExchanger = cfg.getInt("durabilityExchanger", CATEGORY_GENERAL, durabilityExchanger, 0, 100000, "The max durability of the Exchanger (Ignored if powered by FE)");
durabilityDestruction = cfg.getInt("durabilityDestruction", CATEGORY_GENERAL, durabilityDestruction, 0, 100000, "The max durability of the Destruction Gadget (Ignored if powered by FE)");
durabilityCopyPaste = cfg.getInt("durabilityCopyPaste", CATEGORY_GENERAL, durabilityCopyPaste, 0, 100000, "The max durability of the Copy & Paste Gadget (Ignored if powered by FE)");
enablePaste = cfg.getBoolean("enablePaste", CATEGORY_GENERAL, enablePaste, "Set to false to disable the recipe for construction paste.");
enableDestructionTool = cfg.getBoolean("enableDestructionTool", CATEGORY_GENERAL, enableDestructionTool, "Set to false to disable the destruction tool.");
absoluteCoordDefault = cfg.getBoolean("absoluteCoordinateModeDefault", CATEGORY_GENERAL, absoluteCoordDefault, "Determines if the Copy/Paste GUI's coordinate mode starts in 'Absolute' mode by default. Set to true for Absolute, set to False for Relative.");
canOverwriteBlocks = cfg.getBoolean("canOverwriteBlocks", CATEGORY_GENERAL, canOverwriteBlocks, "Whether the Builder / CopyPaste gadgets can overwrite blocks like water, lava, grass, etc (like a player can). False will only allow it to overwrite air blocks.");
cfg.addCustomCategoryComment(CATEGORY_BLACKLIST, "Blacklist configuration");
BlacklistBlocks.getBlacklist(cfg);
}
代码示例来源:origin: SonOfTheStars/Logistics-Pipes-2
/**
* Provides Values of World Category
* @param cfg Config Provider
*/
private static void initWorld(Configuration cfg){
cfg.addCustomCategoryComment(CAT_WORLD, "World settings:");
genTitanium = cfg.getBoolean("genTitanium", CAT_WORLD, true, "Wether or not to Worldgen Titanium. If off, its recommended to disable the Industrial Tier Pipes");
oreRutile[0] = cfg.getInt("rutileVeinSizeMax", CAT_WORLD, 4, 2, 6, "Maximum Vein size of Rutile Ore clusters.(Between 2 and 6");
oreRutile[1] = cfg.getInt("rutileMinY", CAT_WORLD, 8, 8, 16, "Minimum Y height at wich Rutile Spawns.(Between 8 and 16)");
oreRutile[2] = cfg.getInt("rutileMaxY", CAT_WORLD, 30, 20, 45, "Maximum Y height at wich Rutile Spawns.(Between 20 and 40");
oreRutile[3] = cfg.getInt("rutileChunkOccurence", CAT_WORLD, 5, 1, 10, "Number of times Rutile can Spawn within a single chunk.(Between 1 and 10");
oreRutile[4] = cfg.getInt("rutileSPawnWeight", CAT_WORLD, 80, 10, 100, "Spawn Weight of Rutile Ore.(Between 10 and 100)");
retroGen = cfg.getBoolean("retroGen", CAT_WORLD, false, "Wether or not Post-Creation World Gen should be performed.");
retrogenRemaining = cfg.getBoolean("retrogenRemianing", CAT_WORLD, false, "Wether or not there are still Chunks to be retro Generated with LP Ore. DO NOT TOUCH THIS!");
retroGenFlagLog = cfg.getBoolean("retrogenFlagLogging", CAT_WORLD, true, "Wether or not you want LP to log wich Chunks it flags for Retrogen. This can be a bit spammy!");
}
}
内容来源于网络,如有侵权,请联系作者删除!