本文整理汇总了Java中net.minecraftforge.common.config.Configuration.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getBoolean方法的具体用法?Java Configuration.getBoolean怎么用?Java Configuration.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.Configuration
的用法示例。
在下文中一共展示了Configuration.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initAreaProtConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
/**
* Adds configuration entries to the AreaProt category of the config file
* @param cfg Configuration object
*/
private static void initAreaProtConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_AREAPROTECTOR, "Area Protector configuration");
areaProtectorX = cfg.getInt("areaprotectorx", CATEGORY_AREAPROTECTOR, 5, 1, 64,
"Distance from the Area Protector to protect, along the x axis (total distance is 2*this+1)");
areaProtectorY = cfg.getInt("areaprotectory", CATEGORY_AREAPROTECTOR, 5, 1, 64,
"Distance from the Area Protector to protect, along the y axis (total distance is 2*this+1)");
areaProtectorZ = cfg.getInt("areaprotectorz", CATEGORY_AREAPROTECTOR, 5, 1, 64,
"Distance from the Area Protector to protect, along the z axis (total distance is 2*this+1)");
enableMobProtectionAreaProtector = cfg.getBoolean("enablemobprotectionareaprotector", CATEGORY_AREAPROTECTOR, true,
"Set to false to disable teleporting hostile mobs out of the protected area.");
enableArrowProtectionAreaProtector = cfg.getBoolean("enablearrowprotectionareaprotector", CATEGORY_AREAPROTECTOR, true,
"Set to false to disable killing Skeleton arrows shot into the protected area.");
enablePotionProtectionAreaProtector = cfg.getBoolean("enablepotionprotectionareaprotector", CATEGORY_AREAPROTECTOR, true,
"Set to false to disable blocking Witch potions from entering the protected area.");
enableWolfProtectionAreaProtector = cfg.getBoolean("enablewolfprotectionareaprotector", CATEGORY_AREAPROTECTOR, false,
"Set to false to disable calming hostile wolves in the protected area.");
enableSlimeProtectionAreaProtector = cfg.getBoolean("enableslimeprotectionareaprotector", CATEGORY_AREAPROTECTOR, true,
"Set to false to disable teleporting slimes out of the protected area.");
enableAreaProtectorRecipe = cfg.getBoolean("enableareaprotectorrecipe", CATEGORY_AREAPROTECTOR, true,
"Enables the crafting recipe for the Area Protector block.");
}
示例2: setup
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public void setup(Configuration configFile)
{
genCrystalRock = loadCrystal(configFile, "Rock", new String[]{"-1", "1"}, false);
genCrystalSea = loadCrystal(configFile, "Sea", new String[]{"-1", "1"}, false);
genCrystalFlame = loadCrystal(configFile, "Flame", new String[]{"-1"}, true);
genCrystalAir = loadCrystal(configFile, "Air", new String[]{"-1", "1"}, false);
genCrystalVision = loadCrystal(configFile, "Vision", new String[]{"1"}, true);
genCrysagnetite = loadOre(configFile, "Crysagnetite", 15, 25, 1, 3, 1, 2, 0.1f, new String[]{"-1", "1"}, false);
genCrystallizedRedstone = loadOreOnOre(configFile, "Crystallized Redstone", 0, 16, 0.03f, new String[]{"-1", "1"}, false);
genCrystallizedGlowstone = loadOreOnOre(configFile, "Crystallized Glowstone", 4, 123, 0.03f, new String[]{"-1"}, true);
genLabSmall = loadStructure(configFile, "Small Laboratory", 0.0007f, 15, 256, new String[]{"-1", "1"}, false);
genLabMedium = loadStructure(configFile, "Medium Laboratory", 0.0007f, 15, 256, new String[]{"-1", "1"}, false);
genBrulantaFlower = loadGround(configFile, "Brulanta Flower", 3, 256, 0, 4, 0.1f, new String[]{"-1", "1"}, false);
debugMessages = configFile.getBoolean("Debug", GENERAL, false, "Enables or disables the debug logger.");
animateIfTabletPageTransition = configFile.getBoolean("Animate IF Tablet page transitions", CLIENT, true, "");
testItem = configFile.getBoolean("Test Item", CLIENT, false, "Enables or disables the test item made for messing with models.");
if (configFile.hasChanged())
configFile.save();
}
示例3: initGeneralConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
/**
* Adds configuration entries to the General category of the config file
* @param cfg Configuration object
*/
private static void initGeneralConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "General configuration");
ticksToLive = cfg.getInt("ticksbeforedecay", CATEGORY_GENERAL, ticksToLive, -1, Integer.MAX_VALUE,
"How long (in ticks) before the Chunk Protector decays. Set to -1 to disable decay.");
giveNewPlayersProtector = cfg.getBoolean("givenewplayerschunkprotector", CATEGORY_GENERAL, true,
"Set to true to give players a free Chunk Protector when first logging into a world.");
}
示例4: initProtectionConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
/**
* Adds configuration entries to the Protection category of the config file
* @param cfg Configuration object
*/
private static void initProtectionConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_PROTECTION, "Chunk Protector configuration");
enableMobProtection = cfg.getBoolean("enablemobprotection", CATEGORY_PROTECTION, true,
"Set to false to disable teleporting hostile mobs out of the protected area.");
enableArrowProtection = cfg.getBoolean("enablearrowprotection", CATEGORY_PROTECTION, true,
"Set to false to disable killing Skeleton arrows shot into the protected area.");
enablePotionProtection = cfg.getBoolean("enablepotionprotection", CATEGORY_PROTECTION, true,
"Set to false to disable blocking Witch potions from entering the protected area.");
enableWolfProtection = cfg.getBoolean("enablewolfprotection", CATEGORY_PROTECTION, false,
"Set to false to disable calming hostile wolves in the protected area.");
enableSlimeProtection = cfg.getBoolean("enableslimeprotection", CATEGORY_PROTECTION, true,
"Set to false to disable teleporting slimes out of the protected area.");
}
示例5: initGeneralConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initGeneralConfig(Configuration cfg)
{
cfg.addCustomCategoryComment(catGeneral, "General configuration");
shiny_stone_drop_rate = cfg.getInt("shiny_stone_rate", catGeneral, shiny_stone_drop_rate, 0, 100, "Drop rate of shiny stone (percentage)");
butter_emits_redstone_signal = cfg.getBoolean("butter_emits_redstone_signal", catGeneral, butter_emits_redstone_signal, "Whether butter randomly emits a redstone signal");
}
示例6: initPermissionConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initPermissionConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_PERMISSON, "Permission configuration");
for (MeeCreepsApi.Factory factory : MeeCreeps.api.getFactories()) {
boolean allowed = cfg.getBoolean("allowed_" + factory.getId(), CATEGORY_PERMISSON, true, "");
if (allowed) {
allowedActions.add(factory.getId());
}
}
}
示例7: 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");
}
示例8: setupInit
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public void setupInit(Configuration configFile)
{
for(Map.Entry<ResourceLocation, IExpression> expr : PurMag.INSTANCE.getExpressionRegistry().getRegistry().getEntries())
{
boolean bool = configFile.getBoolean(expr.getKey().toString(), EXPRESSIONS, expr.getValue().enabledByDefault(), expr.getValue().getDescription());
if(bool)
enabledExpressions.add(expr.getKey());
}
if (configFile.hasChanged())
configFile.save();
}
示例9: init
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public static void init(File configFile)
{
Configuration config = new Configuration(configFile);
String allowCraftingNote = "Should be TRUE to allow crafting. FALSE to remove recipe.";
// TODO: Rewrite this code.
try {
compositeHelmet = config.getBoolean("composite_helmet", SECTION_CRAFTING, true, allowCraftingNote);
compositeChestplate = config.getBoolean("composite_chestplate", SECTION_CRAFTING, true, allowCraftingNote);
compositeLeggings = config.getBoolean("composite_leggings", SECTION_CRAFTING, true, allowCraftingNote);
compositeBoots = config.getBoolean("composite_boots", SECTION_CRAFTING, true, allowCraftingNote);
compositeSword = config.getBoolean("composite_sword", SECTION_CRAFTING, true, allowCraftingNote);
compositeDagger = config.getBoolean("composite_dagger", SECTION_CRAFTING, true, allowCraftingNote);
compositeBow = config.getBoolean("composite_bow", SECTION_CRAFTING, true, allowCraftingNote);
respiratorHalfMask = config.getBoolean("respirator_halfmask", SECTION_CRAFTING, true, allowCraftingNote);
respiratorMask = config.getBoolean("respirator_mask", SECTION_CRAFTING, true, allowCraftingNote);
respiratorMaskComposite = config.getBoolean("respirator_mask_composite", SECTION_CRAFTING, true, allowCraftingNote);
ushankaHat = config.getBoolean("ushanka_hat", SECTION_CRAFTING, true, allowCraftingNote);
balaclavaMask = config.getBoolean("balaclava_mask", SECTION_CRAFTING, true, allowCraftingNote);
shemaghMask = config.getBoolean("shemagh_mask", SECTION_CRAFTING, true, allowCraftingNote);
} catch (Exception e) {
CompositeGear.modLog.error("Unable to load log file!");
throw new RuntimeException(e);
} finally {
config.save();
}
}
示例10: 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;
}
示例11: 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();
}
示例12: 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;
}
示例13: loadCrystal
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private ConfigCrystalGenEntry loadCrystal(Configuration config, String name, String[] dimList, boolean dimListMode)
{
ConfigCrystalGenEntry entr = new ConfigCrystalGenEntry();
name = name + " Crystal";
entr.generate = config.getBoolean(name, WORLD, true, "");
entr.dimList = loadIntList(config, name + " DimList", WORLD, dimList, "");
entr.dimListMode = config.getBoolean(name + " DimList Mode", WORLD, dimListMode, "True = whitelist; False = blacklist");
return entr;
}
示例14: injectData
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@Override
public void injectData(Map<String, Object> data) {
File file=new File("config","MCRenderCrashFix.conf");
Configuration config=new Configuration(file);
FixRenderManager=config.getBoolean("FixRenderManager","Config",true,"Pervent RenderManager.class to make client crash");
FixRenderItem=config.getBoolean("FixRenderItem","Config",true,"Pervent RenderItem.class to make client crash");
FixRenderBlocks=config.getBoolean("FixRenderBlocks","Config",true,"Pervent RenderBlocks.class to make client crash");
FixFMLHandshakeClientState$7=config.getBoolean("FixFMLHandshakeClientState$7","Config",false,"To remove invoke revertToFrozen method in FixFMLHandshakeClientState$7.class.\nIf you are using same mods in same bungeecord server, you can only enable this option.");
config.save();
}
示例15: call
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@Override
public Void call() throws Exception {
File file = new File("envcheck");
if (!file.exists()) {
file.mkdir();
}
Configuration config = new Configuration(new File(new File("config"), "envcheck.cfg"));
showForgeTransformers = config.getBoolean("showForgeTransformers", "asmTransformerChanges", false, "Whether or not to show the changes done by Forge's own transformers.");;
config.save();
wrapTransformers();
return null;
}