本文整理汇总了Java中codechicken.lib.config.ConfigFile类的典型用法代码示例。如果您正苦于以下问题:Java ConfigFile类的具体用法?Java ConfigFile怎么用?Java ConfigFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigFile类属于codechicken.lib.config包,在下文中一共展示了ConfigFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadConfig
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
private static void loadConfig() {
File file = new File(saveDir, "server.cfg");
serverConfig = new ConfigFile(file);
serverConfig.setNewLineMode(1);
serverConfig.getTag("permissions").useBraces();
serverConfig.getTag("permissions").setComment("List of players who can use these features.\nEg. time=CodeChicken, Friend1");
setDefaultFeature("time");
setDefaultFeature("rain");
setDefaultFeature("heal");
setDefaultFeature("magnet");
setDefaultFeature("creative");
setDefaultFeature("creative+");
setDefaultFeature("adventure");
setDefaultFeature("enchant");
setDefaultFeature("potion");
setDefaultFeature("save-state");
setDefaultFeature("item");
setDefaultFeature("delete");
setDefaultFeature("notify-item", "CONSOLE, OP");
}
示例2: load
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void load() {
CodeChickenCoreModContainer.loadConfig();
ConfigFile config = CodeChickenCoreModContainer.config;
File mcDir = CodeChickenCorePlugin.minecraftDir;
if (config.getTag("dev.deobfuscate")
.setComment("set to true to completely deobfuscate mcp names")
.getBooleanValue(!ObfMapping.obfuscated)) {
run = new ObfuscationRun(false, ObfMapping.MCPRemapper.getConfFiles(),
ObfuscationRun.fillDefaults(new HashMap<String, String>()));
run.obf.setHeirachyEvaluator(instance);
run.setQuiet().parseMappings();
for (String pkg : run.config.get("excludedPackages").split(";"))
excludedPackages.add(pkg);
if (ObfMapping.obfuscated) {
ObfMapping.loadMCPRemapper();
run.setSeargeConstants();
getTransformers().add(instance);
} else {
getTransformers().add(0, instance);//insert transformer as first.
}
}
}
示例3: initConfig
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void initConfig(ConfigFile config) {
config.getTag("players").setPosition(0).useBraces().setComment("Per player chunk limiting. Values ignored if 0.:Simply add <username>=<value>");
config.getTag("players.DEFAULT").setComment("Forge gives everyone 12500 by default").getIntValue(5000);
config.getTag("players.OP").setComment("For server op's only.").getIntValue(5000);
config.getTag("allowoffline").setPosition(1).useBraces().setComment("If set to false, players will have to be logged in for their chunkloaders to work.:Simply add <username>=<true|false>");
config.getTag("allowoffline.DEFAULT").getBooleanValue(true);
config.getTag("allowoffline.OP").getBooleanValue(true);
config.getTag("allowchunkviewer").setPosition(2).useBraces().setComment("Set to false to deny a player access to the chunk viewer");
config.getTag("allowchunkviewer.DEFAULT").getBooleanValue(true);
config.getTag("allowchunkviewer.OP").getBooleanValue(true);
reloadDimensions = config.getTag("reload-dimensions").setComment("Set to false to disable the automatic reloading of mystcraft dimensions on server restart").getBooleanValue(true);
opInteract = config.getTag("op-interact").setComment("Enabling this lets OPs alter other player's chunkloaders. WARNING: If you change a chunkloader, you have no idea what may break/explode by not being chunkloaded.").getBooleanValue(false);
maxChunks = config.getTag("maxchunks").setComment("The maximum number of chunks per chunkloader").getIntValue(400);
awayTimeout = config.getTag("awayTimeout").setComment("The number of minutes since last login within which chunks from a player will remain active, 0 for infinite.").getIntValue(0);
}
示例4: loadConfig
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
private static ConfigFile loadConfig() {
try {//weak reference for environments without FML
File mcDir = (File)((Object[])Class.forName("cpw.mods.fml.relauncher.FMLInjectionData").getMethod("data").invoke(null))[6];
File file = new File(mcDir, "config/CodeChickenLib.cfg");
if(ObfMapping.obfuscated)
return new DefaultingConfigFile(file);
else
return new ConfigFile(file).setComment("CodeChickenLib development configuration file.");
} catch (Exception ignored) {
return null;//no config for these systems
}
}
示例5: loadWorld
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void loadWorld(String saveName) {
setInternalEnabled(true);
logger.debug("Loading "+(Minecraft.getMinecraft().isSingleplayer() ? "Local" : "Remote")+" World");
bootNEI(ClientUtils.getWorld());
File saveDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + saveName);
boolean newWorld = !saveDir.exists();
if (newWorld)
saveDir.mkdirs();
world = new ConfigSet(new File(saveDir, "NEI.dat"), new ConfigFile(new File(saveDir, "NEI.cfg")));
onWorldLoad(newWorld);
}
示例6: init
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void init(File file) {
if (!initialized) {
config = new ConfigFile(file).setComment("EnderStorage Configuration File\n" + "Deleting any element will restore it to it's default value");
initialized = true;
}
loadConfig();
}
示例7: preInit
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
config = new ConfigFile(new File(event.getModConfigurationDirectory(), "ChickenChunks.cfg")).setComment("ChunkLoader Configuration File\nDeleting any element will restore it to it's default value");
proxy.preInit();
ModMetadata metadata = event.getModMetadata();
metadata.description = modifyDesc(metadata.description);
ModDescriptionEnhancer.registerEnhancement(MOD_ID, MOD_NAME);
}
示例8: loadWorld
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void loadWorld(String saveName) {
setInternalEnabled(true);
LogHelper.debug("Loading " + (Minecraft.getMinecraft().isSingleplayer() ? "Local" : "Remote") + " World");
//ItemMobSpawner.loadSpawners(ClientUtils.getWorld());
File saveDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + saveName);
boolean newWorld = !saveDir.exists();
if (newWorld) {
saveDir.mkdirs();
}
world = new ConfigSet(new File(saveDir, "NEI.dat"), new ConfigFile(new File(saveDir, "NEI.cfg")));
onWorldLoad(newWorld);
}
示例9: initConfig
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void initConfig(File file) {
globalconfig = new ConfigFile(file).setComment("Wireless Redstone Chicken Bones Edition Configuration File:Deleting any element will restore it to it's default value");
}
示例10: config
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static ConfigFile config()
{
return globalconfig;
}
示例11: loadConfig
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void loadConfig() {
if(config == null)
config = new ConfigFile(new File(CodeChickenCorePlugin.minecraftDir, "config/CodeChickenCore.cfg")).setComment("CodeChickenCore configuration file.");
}
示例12: loadConfig
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void loadConfig() {
if (config == null) {
config = new ConfigFile(new File(minecraftDir, "config/CodeChickenCore.cfg")).setComment("CodeChickenCore configuration file.");
}
}
示例13: initConfig
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void initConfig() {
if (configFile == null) {
configFile = new ConfigFile(new File((File) FMLInjectionData.data()[6], "config/CodeChickenTweaks.cfg")).setComment("CodeChickenTweaks configuration file.\n" + "Deleting any element will restore it to it's default value");
}
}
示例14: loadConfig
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void loadConfig(ConfigFile config2) {
config = config2;
for (Map.Entry<String, EnderStoragePlugin> plugin : plugins.entrySet()) {
plugin.getValue().loadConfig(config.getTag(plugin.getKey()));
}
}
示例15: init
import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static void init(File file) {
if (!initialized) {
config = new ConfigFile(file).setComment("Translocator Configuration File\n" + "Deleting any element will restore it to it's default value");
initialized = true;
}
}