当前位置: 首页>>代码示例>>Java>>正文


Java ConfigFile类代码示例

本文整理汇总了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");
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:23,代码来源:NEIServerConfig.java

示例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.
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:MCPDeobfuscationTransformer.java

示例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);
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:17,代码来源:ChunkLoaderManager.java

示例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
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:13,代码来源:ASMHelper.java

示例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);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:NEIClientConfig.java

示例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();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:8,代码来源:ConfigurationHandler.java

示例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);
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:9,代码来源:ChickenChunks.java

示例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);
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:15,代码来源:NEIClientConfig.java

示例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");
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:4,代码来源:SaveManager.java

示例10: config

import codechicken.lib.config.ConfigFile; //导入依赖的package包/类
public static ConfigFile config()
{
    return globalconfig;
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:5,代码来源:SaveManager.java

示例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.");
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:CodeChickenCoreModContainer.java

示例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.");
    }
}
 
开发者ID:TheCBProject,项目名称:CodeChickenCore,代码行数:6,代码来源:CodeChickenCorePlugin.java

示例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");
    }
}
 
开发者ID:TheCBProject,项目名称:CCTweaks,代码行数:6,代码来源:CCTweaks.java

示例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()));
    }
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:7,代码来源:EnderStorageManager.java

示例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;
    }
}
 
开发者ID:TheCBProject,项目名称:Translocators,代码行数:7,代码来源:ConfigurationHandler.java


注:本文中的codechicken.lib.config.ConfigFile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。