本文整理汇总了Java中net.minecraftforge.common.config.Configuration.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getString方法的具体用法?Java Configuration.getString怎么用?Java Configuration.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.Configuration
的用法示例。
在下文中一共展示了Configuration.getString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initConfig(Configuration cfg){
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "Configuration");
CharcoalTime=cfg.getInt("CharcoalTime", CATEGORY_GENERAL, 18000, 1000, 1000000, "Time the charcoal pit takes to finish. 1000 Ticks = 1 MC hour");
CokeTime=cfg.getInt("CokeTime", CATEGORY_GENERAL, 36000, 1000, 1000000, "Time the coke oven takes to finish. 1000 Tick = 1 MC hour");
CharcoalCreosote=cfg.getInt("CharcoalCreosote", CATEGORY_GENERAL, 50, 0, 1000, "Amount of Creosote Oil in mB produced per log");
CokeCreosote=cfg.getInt("CokeCreosote", CATEGORY_GENERAL, 100, 0, 1000, "Amount of Creosote Oil in mB produced per coal");
CokeBlocks=cfg.getStringList("CokeBlocks", CATEGORY_GENERAL, new String[]{"minecraft:brick_block","minecraft:nether_brick"}, "List of block registry names that are valid for the coke oven outer shell");
CharcoalMin=cfg.getInt("CharcoalMin", CATEGORY_GENERAL, 3, 0, 1000, "The minimum amount of charcoal a charcoal pile can drop");
CharcoalMax=cfg.getInt("CharcoalMax", CATEGORY_GENERAL, 6, 0, 1000, "The maximum amount of charcoal a charcoal pile can drop without fortune");
CharcoalTotal=cfg.getInt("CharcoalTotal", CATEGORY_GENERAL, 9, 0, 1000, "The maximum amount of charcoal a charcoal pile can ever drop");
CokeMin=cfg.getInt("CokeMin", CATEGORY_GENERAL, 6, 0, 1000, "The minimum amount of coke a coke pile can drop");
CokeMax=cfg.getInt("CokeMax", CATEGORY_GENERAL, 9, 0, 1000, "The maximum amount of coke a coke pile can drop without fortune");
CokeTotal=cfg.getInt("CokeTotal", CATEGORY_GENERAL, 9, 0, 1000, "The maximum amount of coke a coke pile can ever drop");
AllowFortune=cfg.getBoolean("AllowFortune", CATEGORY_GENERAL, true, "If Fortune enchant applies to charcoal/coke piles");
CokeFuel=cfg.getInt("CokeFuel", CATEGORY_GENERAL, 3200, 0, 1000000, "The fuel value of coke. (char)coal is 1600");
CreosoteFuel=cfg.getInt("CreosoteFuel", CATEGORY_GENERAL, 4800, 0, 1000000, "The fuel value of a creosote bucket. (char)coal is 1600");
DisableFurnaceCharcoal=cfg.getBoolean("DisableFurnaceCharcoal", CATEGORY_GENERAL, true, "If the vanilla log->charcoal furnace recipe should be disabled");
AshPreference=cfg.getString("AshPreference", CATEGORY_GENERAL, "forestry:ash", "The prefered ash item to drop from charcoal/coke piles. Defaults to the mod's own if invalid");
AshMeta=cfg.getInt("AshMeta", CATEGORY_GENERAL, 0, 0, Integer.MAX_VALUE, "The metadata of the prefered ash item to drop from charcoal/coke piles");
CokePreference=cfg.getString("CokePreference", CATEGORY_GENERAL, "railcraft:fuel_coke", "The prefered coke item to drop from coke piles. Defaults to mod's own if invalid");
CokeMeta=cfg.getInt("CokeMeta", CATEGORY_GENERAL, 0, 0, Integer.MAX_VALUE, "The metadata of the prefered coke item to drop from coke piles");
RegisterRecipes=cfg.getBoolean("RegisterRecipes", CATEGORY_GENERAL, true, "Set to false to disable hard coded recipes");
PotteryTime=cfg.getInt("PotteryTime", CATEGORY_GENERAL, 8000, 1000, 1000000, "Time the pottery kiln takes to finish. 1000 Ticks = 1 MC hour");
ThatchAmount=cfg.getInt("ThatchAmount", CATEGORY_GENERAL, 1, 1, 64, "The amount of thatch needed by the pottery kiln");
WoodAmount=cfg.getInt("WoodAmount", CATEGORY_GENERAL, 3, 1, 64, "The amount of wood needed by the pottery kiln");
WoodDefault=cfg.getString("WoodDefault", CATEGORY_GENERAL, "minecraft:log", "The wood dropped if a pottery kiln or log pile is dismantled");
ThatchID=cfg.getString("ThatchID", CATEGORY_GENERAL, "minecraft:hay_block", "The block used as thatch for the pottery kiln");
WoodMeta=cfg.getInt("WoodMeta", CATEGORY_GENERAL, 0, 0, Integer.MAX_VALUE, "The metadata of the wood dropped if a pottery kiln or log pile is dismantled");
ThatchMeta=cfg.getInt("ThatchMeta", CATEGORY_GENERAL, 0, 0, Integer.MAX_VALUE, "The metadata of the block used as thatch for the pottery kiln");
DismantleLogPiles=cfg.getBoolean("DismantleLogPiles", CATEGORY_GENERAL, true, "If log piles can be dismantled");
PotteryAsh=cfg.getInt("PotteryAsh", CATEGORY_GENERAL, 4, 0, 64, "The amount of ash dropped by a completed pottery kiln");
RainyPottery=cfg.getBoolean("RainyPottery", CATEGORY_GENERAL, true, "If pottery kilns get extingushed by rain");
DisableVanillaPottery=cfg.getBoolean("DisableVanillaPottery", CATEGORY_GENERAL, true, "If the vanilla methods of making pottery should be disabled");
DisableDefaultPottery=cfg.getBoolean("DisableDefaultPottery", CATEGORY_GENERAL, false, "If the default pottery kiln recipes should be disabled");
PotteryRecipes=cfg.getStringList("PotteryRecipes", CATEGORY_GENERAL, new String[]{""}, "Register custom pottery kiln recipes in the format 'modId:ingredientId' ingredientMeta 'modId:resultId' resultMeta. ex: minecraft:clay_ball 0 minecraft:brick 0");
}
示例2: initGeneralConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initGeneralConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "General configuration");
windowTitle = cfg.getString("windowtitle", CATEGORY_GENERAL, "", "The title of the Minecraft window. Leave blank to keep the default window title for your version of Minecraft.\nSome special values that will be inserted at runtime:\n%mcver% -> The current Minecraft version\n%modcount% -> Number of loaded mods\n%time% -> Current system time\n");
timeFormat = cfg.getString("timeformat", CATEGORY_GENERAL, "h:mm a", "Format to display time in. See http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns");
}
示例3: createConfigs
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public static void createConfigs(FMLPreInitializationEvent event) {
Configuration config = new Configuration(new File(MobOptions.INSTANCE.getConfigFolder() + "/moboptions.cfg"));
config.load();
underground = config.getInt("Sea Level", "Underground Spawning", 50, 0, 255,"Mobs will spawn more often and are unaffected by light below this Y coordinate.");
undergroundChance = config.getFloat("Spawn Chance", "Underground Spawning", .01F, 0F, 1F,"Chance to spawn mobs under sea level. Careful!");
spawnWhitelist = config.getBoolean("Use Whitelist", "Underground Spawning", true,"If set to false Mobs that ignore light-level will act as a blacklist.");
String defaultMobsToSpawn = "Zombie, Skeleton, Creeper, Spider";
defaultMobsToSpawn = config.getString("Mobs that ignore light-level", "Underground Spawning", defaultMobsToSpawn,"Comma seperated list of mobs that will spawn under sea level ignoring light.");
mobsToSpawn = Arrays.asList(defaultMobsToSpawn.replace(" ", "").split(","));
spawnRadius = config.getInt("Spawn Area", "Difficulty Settings", 400, 0, 10000,"Radius around 0,0 to not buff mobs by distance (will still buff from height).");
spawnLocation = config.getBoolean("Spawn Location Calculation", "Difficulty Settings", true, "If true, will calculate against the overworld's actual spawn-point. If false, will calculate the safe-area centered at x=0,z=0");
depthMultiplier = config.getFloat("Depth Multipler", "Difficulty Settings", -.1F, -10F, 10F,"How quickly will mobs get easier or harder as y increases. (negative is easier)");
depthOffset = config.getFloat("Depth Offset", "Difficulty Settings", 5F, 0F, 1000F, "Mob Strength at y=0");
distanceDifficulty = config.getInt("Distance Difficulty", "Difficulty Settings", 200, 0, 1000,"Distance / Difficulty (Lower is harder!)(2000/200 mobs will be level 10)");
attackGain = config.getFloat("Attack Gain", "Difficulty Settings", 0.5F, 0F, 5F,"How much (percentage) attack damage mobs gain approx every two levels.");
probTier5 = config.getFloat("Tier5 Chance", "Armor and Weapons", .01F, 0F, 1F,"Percent a mob will get Tier5 gear per 2 levels approx.");
probTier4 = config.getFloat("Tier4 Chance", "Armor and Weapons", .01F, 0F, 1F,"Percent a mob will get Tier4 gear per 2 levels approx.");
probTier3 = config.getFloat("Tier3 Chance", "Armor and Weapons", .02F, 0F, 1F,"Percent a mob will get Tier3 gear per 2 levels approx.");
probTier2 = config.getFloat("Tier2 Chance", "Armor and Weapons", .04F, 0F, 1F,"Percent a mob will get Tier2 gear per 2 levels approx.");
probTier1 = config.getFloat("Tier1 Chance", "Armor and Weapons", .06F, 0F, 1F,"Percent a mob will get Tier1 gear per 2 levels approx.");
weaponDrop = config.getFloat("Weapon Drop", "Armor and Weapons", .00F, 0F, 1F,"Percent a mob will drop its weapon");
armourDrop = config.getFloat("Armor Drop", "Armor and Weapons", .01F, 0F, 1F,"Percent a mob will drop a piece of armor");
enchantCost = config.getFloat("Enchantment Cost", "Enchantments", 2F, 1F, 100F,"How many levels does it take for a mob to gain an enchantment?");
maxSpeed = config.getFloat("Creeper Max Speed", "Mob Settings", .4F, 0F, 5F,"Max creeper speed. (base speed is .25");
speedGain = config.getFloat("Creeper Speed Gain", "Mob Settings", .01F, 0F, .5F,"Approx. creeper speed gain per 2 levels.");
maxRange = config.getInt("Range Max", "Mob Settings", 80, 16, 100,"Max mob tracking range.");
rangeGain = config.getFloat("Range Gain", "Mob Settings", 1F, 0F, 10F,"Approx. tracking range gain per 2 levels.");
dimData = new HashMap<Integer, DimensionMobOptions>();
String rawDimData = "0, 1, 25, 400, 40 : 7, 5, 30, 500, 50 : -1, 10, 35, 600, 60 : 1, 20, 40, 2000, 75";
rawDimData = config.getString("Dimension Difficulty", "Dimension Settings", rawDimData,"Difficulty settings by dimension. (Dimension ID, Base difficulty, Max difficulty, Health cap, Damage cap) Seperate dimensions with ':', each dimension MUST have 5 values.");
defaultDim = config.getInt("Default Dimension", "Dimension Settings", 0, -10000, 10000,"If a dimension is not specified use the settings of this dimension");
for (String thisDim : rawDimData.replace(" ", "").split(":")) {
String[] thisDimData = thisDim.split(",");
dimData.put(Integer.parseInt(thisDimData[0]),
new DimensionMobOptions(
Integer.parseInt(thisDimData[1]),
Integer.parseInt(thisDimData[2]),
Integer.parseInt(thisDimData[3]),
Integer.parseInt(thisDimData[4]))
);
}
config.save();
}