本文整理汇总了Java中net.minecraftforge.common.config.Configuration.getFloat方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getFloat方法的具体用法?Java Configuration.getFloat怎么用?Java Configuration.getFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.Configuration
的用法示例。
在下文中一共展示了Configuration.getFloat方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGeneralConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initGeneralConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "General configuration");
portalTimeout = cfg.getInt("portalTimeout", CATEGORY_GENERAL, portalTimeout, 1, 1000000, "Amount of ticks until the portalpair disappears");
portalTimeoutAfterEntry = cfg.getInt("portalTimeoutAfterEntry", CATEGORY_GENERAL, portalTimeoutAfterEntry, 1, 1000000, "Amount of ticks until the portalpair disappears after an entity has gone through");
maxCharge = cfg.getInt("maxCharge", CATEGORY_GENERAL, maxCharge, 1, 1000000, "Maximum charge in a portalgun/cartridge");
chargesPerEnderpearl = cfg.getInt("chargesPerEnderpearl", CATEGORY_GENERAL, chargesPerEnderpearl, 1, 1000000, "Number of charges per enderpearl");
meeCreepBoxMaxUsage = cfg.getInt("meeCreepBoxMaxUsage", CATEGORY_GENERAL, meeCreepBoxMaxUsage, -1, 1000000, "Maximum number of uses for a single MeeCreep box (-1 means unlimited)");
maxMeecreepsPerPlayer = cfg.getInt("maxMeecreepsPerPlayer", CATEGORY_GENERAL, maxMeecreepsPerPlayer, -1, 1000000, "Maximum number of active MeeCreeps per player (-1 means unlimited)");
meeCreepVolume = cfg.getFloat("meeCreepVolume", CATEGORY_GENERAL, meeCreepVolume, 0, 1, "Volume of the MeeCreep");
teleportVolume = cfg.getFloat("teleportVolume", CATEGORY_GENERAL, teleportVolume, 0, 1, "Volume of the Portal Gun");
messageX = cfg.getInt("messageX", CATEGORY_GENERAL, messageX, -100, 100, "Balloon horizontal postion: 0 means centered, positive means percentage offset from left side, negative means percentage offset from right side");
messageY = cfg.getInt("messageY", CATEGORY_GENERAL, messageY, -100, 100, "Balloon vertical position: 0 means centered, positive means percentage offset from top side, negative means percentage offset from bottom side");
messageTimeout = cfg.getInt("messageTimeout", CATEGORY_GENERAL, messageTimeout, 1, 10000, "Number of ticks (20 ticks per second) before the balloon message disappears");
maxSpawnCount = cfg.getInt("maxSpawnCount", CATEGORY_GENERAL, maxSpawnCount, 1, 200, "Spawn cap for an angry MeeCreep (a MeeCreep with a box)");
maxTreeBlocks = cfg.getInt("maxTreeBlocks", CATEGORY_GENERAL, maxTreeBlocks, 1, 100000, "Maximum number of tree blocks a single MeeCreep can chop down");
delayAtHardness = cfg.getFloat("delayAtHardness", CATEGORY_GENERAL, delayAtHardness, 0, 10000000, "Delay harvest of blocks if hardness is bigger then this value");
delayFactor = cfg.getFloat("delayFactor", CATEGORY_GENERAL, delayFactor, 0, 1000, "Speed modifier for harvesting (i.e. how much faster a MeeCreep is compared to a player)");
}
示例2: loadOre
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private ConfigOregenEntry loadOre(Configuration config, String name, int minY, int maxY, int minVs, int maxVs, int minVeins, int maxVeins, float chance, String[] dimList, boolean dimListMode)
{
ConfigOregenEntry entr = new ConfigOregenEntry();
entr.generate = config.getBoolean(name, WORLD, true, "");
entr.minY = config.getInt(name + " Min Y", WORLD, minY, 0, Integer.MAX_VALUE, "");
entr.maxY = config.getInt(name + " Max Y", WORLD, maxY, 0, Integer.MAX_VALUE, "");
entr.minVeinSize = config.getInt(name + " Min Vein Size", WORLD, minVs, 0, Integer.MAX_VALUE, "");
entr.maxVeinSize = config.getInt(name + " Max Vein Size", WORLD, maxVs, 0, Integer.MAX_VALUE, "");
entr.minVeins = config.getInt(name + " Min Veins Per Chunk", WORLD, minVeins, 0, Integer.MAX_VALUE, "");
entr.maxVeins = config.getInt(name + " Max Veins Per Chunk", WORLD, maxVeins, 0, Integer.MAX_VALUE, "");
entr.chance = config.getFloat(name + " Generation Chance", WORLD, chance, 0, 1, "");
entr.dimList = loadIntList(config, name + " DimList", WORLD, dimList, "");
entr.dimListMode = config.getBoolean(name + " DimList Mode", WORLD, dimListMode, "True = whitelist; False = blacklist");
return entr;
}
示例3: ProspectingConfiguration
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public ProspectingConfiguration(FMLPreInitializationEvent e) {
final Configuration config = new Configuration(e.getSuggestedConfigurationFile());
config.load();
// this.nugget_amount = config.getInt("Nuggets Per Chunk", "General", 1, 0, 999999999, "The number of nuggets that can be prospected in a chunk, if it has applicable ore in it.");
this.chunk_expiry = config.getInt("Chunk Expiry", "Caching", 300, 1, 999999999, "The number of seconds until a chunk's cache expires. After the cache expires, the chunk will be re-scanned for ore when it is prospected.");
this.nugget_chance = config.getFloat("Nugget Chance", "Probabilities", 0.8f, 0f, 1f, "The chance that a chunk will have nuggets. The number of nuggets produced is determined by the \"Ore Per Nugget\" setting");
this.ore_per_nugget = config.getInt("Ore Per Nugget", "Probabilities", 50, 0, 4096, "The number of ore, on average, that will produce 1 nugget in a chunk. For example, if this value is 50, and a chunk has 100 iron ore, you can expect to get 2 nuggets from the chunk through prospecting.");
this.ore_per_nugget_deviation = config.getInt("Ore Per Nugget Deviation", "Probabilities", 10, 0, 4096, "The maximum deviation for nugget calculations. Your value for \"Ore Per Nugget\" well be randomly modified +- this value when calculating nuggets.");
this.max_nuggets = config.getInt("Maximum Nugget Count", "Probabilities", 5, 0, 4096, "The maximum number of nuggets to spawn in a given chunk for each ore.");
this.flower_chance = config.getFloat("Flower Chance", "Probabilities", 0.8f, 0f, 1f, "The chance that a given chunk will produce flowers, if it contains ore. The number of flowers produced is determined by the \"Ore Per Flower\" setting.");
this.flower_false_chance = config.getFloat("Flower False Positive Chance", "Probabilities", 0.05f, 0f, 1f, "This chance that a chunk will have some indicator flowers spawn despite having no ore.");
this.ore_per_flower = config.getInt("Ore Per Flower", "Probabilities", 50, 0, 4096, "The number of ore, on average, that it takes to produce 1 flower on the surface.");
this.ore_per_flower_deviation = config.getInt("Ore Per Flower Deviation", "Probabilities", 10, 0, 4096, "The maximum deviation for flower calculations. Your value for \"Ore Per Flower\" well be randomly modified +- this value when calculating flowers.");
this.max_flowers = config.getInt("Maximum Flower Count", "Probabilities", 10, 0, 4096, "The maximum number of flowers to spawn in a given chunk for each type of ore.");
config.save();
}
示例4: initEffectsSettings
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initEffectsSettings(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_EFFECTS, "Effect settings");
POTION_EFFECTS_PLAYER = cfg.getStringList("potionEffectsPlayer", CATEGORY_EFFECTS, POTION_EFFECTS_PLAYER, "A list of potion effects with every string of the form: 'amount,id[@amplitude]'");
POTION_EFFECTS_PASSIVE = cfg.getStringList("potionEffectsPassive", CATEGORY_EFFECTS, POTION_EFFECTS_PASSIVE, "A list of potion effects with every string of the form: 'amount,id[@amplitude]'");
POTION_EFFECTS_HOSTILE = cfg.getStringList("potionEffectsHostile", CATEGORY_EFFECTS, POTION_EFFECTS_HOSTILE, "A list of potion effects with every string of the form: 'amount,id[@amplitude]'");
PROTECTIVE_HELMET_FACTOR = cfg.getFloat("protectiveHelmetFactor", CATEGORY_EFFECTS, PROTECTIVE_HELMET_FACTOR, 0, 1, "How much the protective helmet reduces the poison. 0 means full poison reduction, 1 means no effect");
DIMENSIONS_WITH_POISON = cfg.getStringList("dimensionsWithPoison", CATEGORY_EFFECTS, DIMENSIONS_WITH_POISON, "List of dimensions where the air is poisonous. Use 'all' if you want all of them");
DIMENSIONS_WITHOUT_POISON = cfg.getStringList("dimensionsWithoutPoison", CATEGORY_EFFECTS, DIMENSIONS_WITHOUT_POISON, "List of dimensions where the air is not poisonous. Used when 'dimensionsWithPoison' is equal to 'all'");
PLANT_GROWTH_POISON_DENY = cfg.getInt("plantGrowthPoisonDeny", CATEGORY_EFFECTS, PLANT_GROWTH_POISON_DENY, 0, 256, "If poison is above this level plants cannot grow (256 to disable)");
PLANT_GROWTH_POISON_SLOW = cfg.getInt("plantGrowthPoisonSlow", CATEGORY_EFFECTS, PLANT_GROWTH_POISON_SLOW, 0, 256, "If poison is above this level plants grow slower (256 to disable)");
PLANT_GROWTH_SLOWDOWN_FACTOR = cfg.getFloat("plantGrowthPoisonSlow", CATEGORY_EFFECTS, PLANT_GROWTH_SLOWDOWN_FACTOR, 0, 1, "How much is plant growth made slower. 0 means no slow down, 1 means no growth ever");
}
示例5: preInit
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
logger = LogManager.getLogger("lagssie");
config = new Configuration(event.getSuggestedConfigurationFile());
intervalClient = config.getFloat("intervalClient", "general", 0.25f, 0f, 1000.0f, "If the client is stuck longer than this amount of time (in seconds), dump a stacktrace of what it is doing. Set to 0 to disable.");
intervalServer = config.getFloat("intervalServer", "general", 0.25f, 0f, 1000.0f, "If the server is stuck longer than this amount of time (in seconds), dump a stacktrace of what it is doing. Set to 0 to disable.");
config.save();
}
示例6: loadOreOnOre
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private ConfigOreOnOreEntry loadOreOnOre(Configuration config, String orename, int minY, int maxY, float chance, String[] dimList, boolean dimListMode)
{
ConfigOreOnOreEntry entr = new ConfigOreOnOreEntry();
entr.generate = config.getBoolean(orename, WORLD, true, "");
entr.minY = config.getInt(orename + " Min Y", WORLD, minY, 0, Integer.MAX_VALUE, "");
entr.maxY = config.getInt(orename + " Max Y", WORLD, maxY, 0, Integer.MAX_VALUE, "");
entr.chance = config.getFloat(orename + " Generation Chance", WORLD, chance, 0, 1, "");
entr.dimList = loadIntList(config, orename + " DimList", WORLD, dimList, "");
entr.dimListMode = config.getBoolean(orename + " DimList Mode", WORLD, dimListMode, "True = whitelist; False = blacklist");
return entr;
}
示例7: loadStructure
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private ConfigStructureEntry loadStructure(Configuration config, String name, float chance, int minY, int maxY, String[] dimList, boolean dimListMode)
{
ConfigStructureEntry entr = new ConfigStructureEntry();
entr.generate = config.getBoolean(name, WORLD, true, "");
entr.chance = config.getFloat(name + " Generation Chance", WORLD, chance, 0, 1, "");
entr.dimList = loadIntList(config, name + " DimList", WORLD, dimList, "");
entr.dimListMode = config.getBoolean(name + " DimList Mode", WORLD, dimListMode, "True = whitelist; False = blacklist");
entr.minY = config.getInt(name + " Min Y", WORLD, minY, 0, Integer.MAX_VALUE, "");
entr.maxY = config.getInt(name + " Max Y", WORLD, maxY, 0, Integer.MAX_VALUE, "");
return entr;
}
示例8: loadGround
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private ConfigGroundgenEntry loadGround(Configuration config, String name, int minY, int maxY, int minCount, int maxCount, float chance, String[] dimList, boolean dimListMode)
{
ConfigGroundgenEntry entr = new ConfigGroundgenEntry();
entr.generate = config.getBoolean(name, WORLD, true, "");
entr.minY = config.getInt(name + " Min Y", WORLD, minY, 0, Integer.MAX_VALUE, "");
entr.maxY = config.getInt(name + " Max Y", WORLD, maxY, 0, Integer.MAX_VALUE, "");
entr.minCount = config.getInt(name + " Min Count Per Chunk", WORLD, minCount, 0, Integer.MAX_VALUE, "");
entr.maxCount = config.getInt(name + " Max Count Per Chunk", WORLD, maxCount, 0, Integer.MAX_VALUE, "");
entr.chance = config.getFloat(name + " Generation Chance", WORLD, chance, 0, 1, "");
entr.dimList = loadIntList(config, name + " DimList", WORLD, dimList, "");
entr.dimListMode = config.getBoolean(name + " DimList Mode", WORLD, dimListMode, "True = whitelist; False = blacklist");
return entr;
}
示例9: init
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public static void init(FMLPreInitializationEvent e) {
config = new Configuration(e.getSuggestedConfigurationFile());
config.load();
stoneballDamage = config.getFloat("stoneballDamage", Configuration.CATEGORY_GENERAL,
2f, 0f, 4096f, "damage of stone ball");
metalballDamage = config.getFloat("metalballDamage", Configuration.CATEGORY_GENERAL,
6f, 0f, 4096f, "damage of metal ball");
enderballDamage = config.getFloat("enderballDamage", Configuration.CATEGORY_GENERAL,
10f, 0f, 4096f, "damage of ender ball");
if (config.hasChanged())
config.save();
}
示例10: commonPreinit
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public static final void commonPreinit(FMLPreInitializationEvent e) {
Configuration config = new Configuration(new File(e.getModConfigurationDirectory(), "/miningwells/config.cfg"));
config.load();
displayMiningWellJoke = config.getBoolean("displayMiningWellJoke", "misc", true, "Displays the a pun on all Mining Well items. Yes, very necessary.");
ticksBetweenMining = config.getInt("ticksBetweenMining", "miningwell", 0, 0, 35, "The minimum number of ticks per mining operation. 0 means that the next block will be broken in the next tick, if power supply is high enough.");
energyPerOperation = config.getInt("energyPerOperation", "miningwell", 256, 20, 1200, "The number of energy units per operation (this is multiplied by the hardness of a block + 1). If this number is 20, stone will require 40 to mine. Subtract and extra 20 for exact calculations.");
maxEnergy = config.getInt("maxEnergy", "miningwell", 16384, 100, 1000000, "The maximum number of energy units that can be stored inside the mining well.");
silkRatio = config.getFloat("silkRation", "miningwell", 1.0f, 0.0f, 10.0f, "The required energy is multiplied by this number if a silk touch upgrade is present, and then added back to the required energy.");
fortuneRatio = config.getFloat("fortuneRatio", "miningwell", 0.45f, 0.0f, 3.0f, "The level of fortune present is multiplied by this, then the required energy is multiplied by that, and then added back to the required energy.");
config.save();
}
示例11: 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();
}