本文整理汇总了Java中net.minecraftforge.common.config.Configuration.getStringList方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getStringList方法的具体用法?Java Configuration.getStringList怎么用?Java Configuration.getStringList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.Configuration
的用法示例。
在下文中一共展示了Configuration.getStringList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preLoad
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@Mod.EventHandler
public void preLoad(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
config.addCustomCategoryComment("general", "General settings");
fancyWeightage = config.getInt("fancyWeightage", "general", 80, 0, 100, "Weightage of llamas wearing parts of their outfit, in percentage% (0-100)");
randomizeParts = config.getInt("randomizeParts", "general", 1, 0, 1, "0 = Render the entire outfit (except disabled parts)\n1 = Randomly choose which parts of the outfit to render (per llama)");
disabledParts = config.getStringList("disabledParts", "general", disabledParts, "Disable parts of the outfit", new String[] { "hat", "monocle", "pipe", "bowtie", "fez", "moustache" });
if(config.hasChanged())
{
config.save();
}
MinecraftForge.EVENT_BUS.register(this);
}
示例2: 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");
}
示例3: 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");
}
示例4: loadIntList
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private List<Integer> loadIntList(Configuration configFile, String name, String category, String[] defaults, String descr)
{
String[] rcbld = configFile.getStringList(name, category, defaults, descr);
List<Integer> lst = new ArrayList<>();
for (String s : rcbld)
{
if (!StringUtils.isNullOrEmpty(s))
{
lst.add(Integer.parseInt(s));
}
}
return lst;
}
示例5: initGeneralSettings
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initGeneralSettings(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "General settings");
BLOCKS_BLOCKING = cfg.getStringList("blocksBlocking", CATEGORY_GENERAL, BLOCKS_BLOCKING, "List of blocks that block poison");
BLOCKS_NONBLOCKING = cfg.getStringList("blocksNonBlocking", CATEGORY_GENERAL, BLOCKS_NONBLOCKING, "List of blocks that don't block poison");
}