Package net.minecraftforge.common

Examples of net.minecraftforge.common.Configuration


    public void preLoad(FMLPreInitializationEvent event) {
        String proxyPath = "denoflionsx.denLib.Mod.Proxy";
        this.setupProxy(proxyPath + ".denLibClientProxy", proxyPath + ".denLibCommonProxy");
        denLibMod.tuning = new TunableManager();
        configManager = new DenConfig();
        config = new Configuration(event.getSuggestedConfigurationFile());
        DictionaryHandler = new DictionaryHandler();
        fluids = new DenLibFluidHandler();
        dict = new DenLibDictionaryHandler();
        Proxy.registerForgeSubscribe(DictionaryHandler);
        try {
View Full Code Here


    public Configuration setup(File origin, File configFile) {
        return setup(origin, configFile, null);
    }

    public Configuration setup(File origin, File configFile, String modID) {
        Configuration config = new Configuration(configFile);
        try {
            ArrayList<Field> fields = denLib.FileUtils.findFieldsInJarWithAnnotation(origin, ConfigField.class);
            for (Field f : fields) {
                f.setAccessible(true);
                ConfigField anno = f.getAnnotation(ConfigField.class);
View Full Code Here

    public static CommonProxy proxy;

    @PreInit
    public void PreInit(FMLPreInitializationEvent evt)
    {
        Configuration cfg = new Configuration(evt.getSuggestedConfigurationFile());

        try {
            cfg.load();
        } catch (Exception e) {
            FMLLog.log(Level.SEVERE, e, "UsefullThings config error");
        }

        Property firstblockId = cfg.getOrCreateBlockIdProperty("cobblegen.id", 200);
        Property luminolampId = cfg.getOrCreateBlockIdProperty("luminolamp.id", 201);
        Property engineId = cfg.getOrCreateBlockIdProperty("engine.id", 202);
        firstblockId.comment = "Block Id of cogglegen machines";
        luminolampId.comment = "Block Id of luminescence lighting";
        engineId.comment = "Block Id of Engine blocks";
        usefullthingsblockId = firstblockId.getInt(200);
        luminolampBlockId = luminolampId.getInt(201);
        usefullengineBlockId = engineId.getInt(202);
       
        cfg.save();
    }
View Full Code Here

@EventHandler
public void PreInit(FMLPreInitializationEvent PreEvent){
  //Cape Stuff
    DevCapesUtil.getInstance().addFileUrl("https://dl.dropboxusercontent.com/u/176170295/MechaniCraftCapes.txt");
 
  Configuration Config = new Configuration(PreEvent.getSuggestedConfigurationFile());
 
  Config.load();
 
  //Items
  int RubyID = Config.getItem("Ruby", 3840).getInt();
  int PureCrystalID = Config.getItem("PureCrystal", 3841).getInt();
  int EvilCrystalID = Config.getItem("EvilCrystal", 3842).getInt();
  int SapphireID = Config.getItem("Sapphire", 3843).getInt();
  int EndIngotID = Config.getItem("EndIngot", 3844).getInt();
  int GlassIngotID = Config.getItem("GlassIngot", 3845).getInt();
  int ObsidianChunkID = Config.getItem("ObsidianChunk", 3846).getInt();
  int ObsidianIngotID = Config.getItem("ObsidianIngot", 3847).getInt();
  int TinIngotID = Config.getItem("TinIngot", 3848).getInt();
  int CopperIngotID = Config.getItem("CopperIngot", 3849).getInt();
  int BronzeIngotID = Config.getItem("BronzeIngot", 3850).getInt();
  int TinNuggetID = Config.getItem("TinNugget", 3851).getInt();
  int IronNuggetID = Config.getItem("IronNugget", 3852).getInt();
  int CopperNuggetID = Config.getItem("CopperNugget", 3853).getInt();
  int TinDustID = Config.getItem("TinDust", 3854).getInt();
  int IronDustID = Config.getItem("IronDust", 3855).getInt();
  int CopperDustID = Config.getItem("CopperDust", 3856).getInt();
  int GoldDustID = Config.getItem("GoldDust", 3857).getInt();
 
  //Machine Items
  int OreGrinderBladeID = Config.getItem("OreGrinderBlade", 3858).getInt();
  int FurnaceSmeltryID = Config.getItem("FurnaceSmeltry", 3859).getInt();
  int MachineFramePartID = Config.getItem("MachineFramePart", 3860).getInt();
 
  //Food
  int RawLambchopID = Config.getItem("RawLambchop", 3870).getInt();
  int CookedLambchopID = Config.getItem("CookedLambchop", 3871).getInt();
 
  //Weapons
  int GlassSwordID = Config.getItem("GlassSword", 3900).getInt();
  int RubySwordID = Config.getItem("RubySword", 3901).getInt();
  int EmeraldSwordID = Config.getItem("EmeraldSword", 3902).getInt();
  int SapphireSwordID = Config.getItem("SapphireSword", 3903).getInt();
  int ObsidianSwordID = Config.getItem("ObsidianSword", 3904).getInt();
  int EndSwordID = Config.getItem("EndSword", 3905).getInt();
  int EvilSwordID = Config.getItem("EvilSword", 3906).getInt();
  int PureSwordID = Config.getItem("PureSword", 3907).getInt();
  int BronzeSwordID = Config.getItem("BronzeSword", 3908).getInt();
 
  //Tools
  int GlassHoeID = Config.getItem("GlassHoe", 3909).getInt();
  int GlassShovelID = Config.getItem("GlassShovel", 3910).getInt();
  int GlassAxeID = Config.getItem("GlassAxe", 3911).getInt();
  int GlassPickaxeID = Config.getItem("GlassPickaxe", 3912).getInt();
 
  int RubyHoeID = Config.getItem("RubyHoe", 3913).getInt();
  int RubyShovelID = Config.getItem("RubyShovel", 3914).getInt();
  int RubyAxeID = Config.getItem("RubyAxe", 3915).getInt();
  int RubyPickaxeID = Config.getItem("RubyPickaxe", 3916).getInt();
 
  int EmeraldHoeID = Config.getItem("EmeraldHoe", 3917).getInt();
  int EmeraldShovelID = Config.getItem("EmeraldShovel", 3918).getInt();
  int EmeraldAxeID = Config.getItem("EmeraldAxe", 3919).getInt();
  int EmeraldPickaxeID = Config.getItem("EmeraldPickaxe", 3920).getInt();
 
  int SapphireHoeID = Config.getItem("SapphireHoe", 3921).getInt();
  int SapphireShovelID = Config.getItem("SapphireShovel", 3922).getInt();
  int SapphireAxeID = Config.getItem("SapphireAxe", 3923).getInt();
  int SapphirePickaxeID = Config.getItem("SapphirePickaxe", 3924).getInt();
 
  int ObsidianHoeID = Config.getItem("ObsidianHoe", 3925).getInt();
  int ObsidianShovelID = Config.getItem("ObsidianShovel", 3926).getInt();
  int ObsidianAxeID = Config.getItem("ObsidianAxe", 3927).getInt();
  int ObsidianPickaxeID = Config.getItem("ObsidianPickaxe", 3928).getInt();
 
  int EndHoeID = Config.getItem("EndHoe", 3929).getInt();
  int EndShovelID = Config.getItem("EndShovel", 3930).getInt();
  int EndAxeID = Config.getItem("EndAxe", 3931).getInt();
  int EndPickaxeID = Config.getItem("EndPickaxe", 3932).getInt();
 
  int EvilHoeID = Config.getItem("EvilHoe", 3933).getInt();
  int EvilShovelID = Config.getItem("EvilShovel", 3934).getInt();
  int EvilAxeID = Config.getItem("EvilAxe", 3935).getInt();
  int EvilPickaxeID = Config.getItem("EvilPickaxe", 3936).getInt();
 
  int PureHoeID = Config.getItem("PureHoe", 3937).getInt();
  int PureShovelID = Config.getItem("PureShovel", 3938).getInt();
  int PureAxeID = Config.getItem("PureAxe", 3939).getInt();
  int PurePickaxeID = Config.getItem("PurePickaxe", 3940).getInt();
 
  int BronzeHoeID = Config.getItem("BronzeHoe", 3941).getInt();
  int BronzeShovelID = Config.getItem("BronzeShovel", 3942).getInt();
  int BronzeAxeID = Config.getItem("BronzeAxe", 3943).getInt();
  int BronzePickaxeID = Config.getItem("BronzePickaxe", 3944).getInt();
 
  //Armor
  int GlassHelmetID = Config.getItem("GlassHelmet", 4000).getInt();
  int GlassChestplateID = Config.getItem("GlassChestplate", 4001).getInt();
  int GlassLeggingsID = Config.getItem("GlassLeggings", 4002).getInt();
  int GlassBootsID = Config.getItem("GlassBoots", 4003).getInt();
 
  int RubyHelmetID = Config.getItem("RubyHelmet", 4004).getInt();
  int RubyChestplateID = Config.getItem("RubyChestplate", 4005).getInt();
  int RubyLeggingsID = Config.getItem("RubyLeggings", 4006).getInt();
  int RubyBootsID = Config.getItem("RubyBoots", 4007).getInt();
 
  int EmeraldHelmetID = Config.getItem("EmeraldHelmet", 4008).getInt();
  int EmeraldChestplateID = Config.getItem("EmeraldChestplate", 4009).getInt();
  int EmeraldLeggingsID = Config.getItem("EmeraldLeggings", 4010).getInt();
  int EmeraldBootsID = Config.getItem("EmeraldBoots", 4011).getInt();
 
  int SapphireHelmetID = Config.getItem("SapphireHelmet", 4012).getInt();
  int SapphireChestplateID = Config.getItem("SapphireChestplate", 4013).getInt();
  int SapphireLeggingsID = Config.getItem("SapphireLeggings", 4014).getInt();
  int SapphireBootsID = Config.getItem("SapphireBoots", 4015).getInt();
 
  int ObsidianHelmetID = Config.getItem("ObsidianHelmet", 4016).getInt();
  int ObsidianChestplateID = Config.getItem("ObsidianChestplate", 4017).getInt();
  int ObsidianLeggingsID = Config.getItem("ObsidianLeggings", 4018).getInt();
  int ObsidianBootsID = Config.getItem("ObsidianBoots", 4019).getInt();
 
  int EndHelmetID = Config.getItem("EndHelmet", 4020).getInt();
  int EndChestplateID = Config.getItem("EndChestplate", 4021).getInt();
  int EndLeggingsID = Config.getItem("EndLeggings", 4022).getInt();
  int EndBootsID = Config.getItem("EndBoots", 4023).getInt();
 
  int EvilHelmetID = Config.getItem("EvilHelmet", 4024).getInt();
  int EvilChestplateID = Config.getItem("EvilChestplate", 4025).getInt();
  int EvilLeggingsID = Config.getItem("EvilLeggings", 4026).getInt();
  int EvilBootsID = Config.getItem("EvilBoots", 4027).getInt();
 
  int PureHelmetID = Config.getItem("PureHelmet", 4028).getInt();
  int PureChestplateID = Config.getItem("PureChestplate", 4029).getInt();
  int PureLeggingsID = Config.getItem("PureLeggings", 4030).getInt();
  int PureBootsID = Config.getItem("PureBoots", 4031).getInt();
 
  int BronzeHelmetID = Config.getItem("BronzeHelmet", 4032).getInt();
  int BronzeChestplateID = Config.getItem("BronzeChestplate", 4033).getInt();
  int BronzeLeggingsID = Config.getItem("BronzeLeggings", 4034).getInt();
  int BronzeBootsID = Config.getItem("BronzeBoots", 4035).getInt();
 
  //Blocks
  int CopperOreID = Config.getBlock("CopperOre", 3500).getInt();
  int TinOreID = Config.getBlock("TinOre", 3501).getInt();
  int RubyOreID = Config.getBlock("RubyOre", 3502).getInt();
  int EvilOreID = Config.getBlock("EvilOre", 3503).getInt();
  int PureOreID = Config.getBlock("PureOre", 3504).getInt();
  int SapphireOreID = Config.getBlock("SapphireOre", 3505).getInt();
  int BronzeBlockID = Config.getBlock("BronzeBlock", 3506).getInt();
  int EndBlockID = Config.getBlock("EndBlock", 3507).getInt();
  int TinBlockID = Config.getBlock("TinBlock", 3508).getInt();
  int CopperBlockID = Config.getBlock("CopperBlock", 3509).getInt();
  int RubyBlockID = Config.getBlock("RubyBlock", 3510).getInt();
  int SapphireBlockID = Config.getBlock("SapphireBlock", 3511).getInt();
  int PureGemBlockID = Config.getBlock("PureGemBlock", 3512).getInt();
  int EvilGemBlockID = Config.getBlock("EvilGemBlock", 3513).getInt();
 
  int ChiseledQuartzBrickID = Config.getBlock("ChiseledQuartzBrick", 3514).getInt();
  int QuartzBrickID = Config.getBlock("QuartzBrick", 3515).getInt();
 
  //Machines
  int IronFurnaceIdleID = Config.getBlock("IronFurnaceIdle", 3516).getInt();
  int IronFurnaceBurningID = Config.getBlock("IronFurnaceBurning", 3517).getInt();
 
  int OreGrinderIdleID = Config.getBlock("OreGrinderIdle", 3518).getInt();
  int OreGrinderBurningID = Config.getBlock("OreGrinderBurning", 3519).getInt();
 
  int MachineFrameID = Config.getBlock("MachineFrame", 3520).getInt();
 
 
 
  Config.save();
 
  MechaniCraftBlocks = new CreativeTabs("MechaniCraftBlocks"){ public ItemStack getIconItemStack(){ return new ItemStack(Block.obsidian);}};
  MechaniCraftCombat = new CreativeTabs("MechaniCraftCombat"){ public ItemStack getIconItemStack(){ return new ItemStack(MechaniCraft.ObsidianSword);}};
  MechaniCraftTools = new CreativeTabs("MechaniCraftTools"){ public ItemStack getIconItemStack(){ return new ItemStack(MechaniCraft.ObsidianPickaxe);}};
  MechaniCraftMachines = new CreativeTabs("MechaniCraftMachines"){ public ItemStack getIconItemStack(){ return new ItemStack(MechaniCraft.IronFurnaceBurning);}};
View Full Code Here

    this.modname = modname;
    this.modversion = modversion;

    // load the config
    configuration = new Configuration(getConfigFile());

    // Get values, and add some defaults, if needed
    configuration.get(Configuration.CATEGORY_GENERAL, "opt-out", false,
        "Set to true to disable all reporting");
    guid = configuration.get(Configuration.CATEGORY_GENERAL, "guid", UUID
View Full Code Here

  @SuppressWarnings("FieldRepeatedlyAccessedInMethod")
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    Log.fixGuiLogging();
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    String GENERAL = Configuration.CATEGORY_GENERAL;

    TicksCommand.name = config.get(GENERAL, "ticksCommandName", TicksCommand.name, "Name of the command to be used for performance stats. Defaults to ticks.").getString();
    TPSCommand.name = config.get(GENERAL, "tpsCommandName", TPSCommand.name, "Name of the command to be used for TPS reports.").getString();
    ProfileCommand.name = config.get(GENERAL, "profileCommandName", ProfileCommand.name, "Name of the command to be used for profiling reports.").getString();
    DumpCommand.name = config.get(GENERAL, "dumpCommandName", DumpCommand.name, "Name of the command to be used for profiling reports.").getString();
    messageDeadlockDetected = config.get(GENERAL, "messageDeadlockDetected", messageDeadlockDetected, "The message to be displayed if a deadlock is detected. (Only sent if exitOnDeadlock is on)").getString();
    messageDeadlockRecovered = config.get(GENERAL, "messageDeadlockRecovered", messageDeadlockRecovered, "The message to be displayed if the server recovers from an apparent deadlock. (Only sent if exitOnDeadlock is on)").getString();
    messageDeadlockSavingExiting = config.get(GENERAL, "messageDeadlockSavingExiting", messageDeadlockSavingExiting, "The message to be displayed when the server attempts to save and stop after a deadlock. (Only sent if exitOnDeadlock is on)").getString();
    tickThreads = config.get(GENERAL, "tickThreads", tickThreads, "number of threads to use to tick. 0 = automatic").getInt(tickThreads);
    saveInterval = config.get(GENERAL, "saveInterval", saveInterval, "Time between partial saves, in ticks.").getInt(saveInterval);
    deadLockTime = config.get(GENERAL, "deadLockTime", deadLockTime, "The time(seconds) of being frozen which will trigger the DeadLockDetector. Set to 1 to instead detect lag spikes.").getInt(deadLockTime);
    chunkCacheSize = Math.max(100, config.get(GENERAL, "chunkCacheSize", chunkCacheSize, "Number of unloaded chunks to keep cached. Replacement for Forge's dormant chunk cache, which tends to break. Minimum size of 100").getInt(chunkCacheSize));
    chunkGCInterval = config.get(GENERAL, "chunkGCInterval", chunkGCInterval, "Interval between chunk garbage collections in ticks").getInt(chunkGCInterval);
    targetTPS = config.get(GENERAL, "targetTPS", targetTPS, "TPS the server should try to run at.").getInt(targetTPS);
    maxItemsPerChunk = config.get(GENERAL, "maxItemsPerChunk", maxItemsPerChunk, "Maximum number of entity items allowed per chunk. 0 = no limit.").getInt(maxItemsPerChunk);
    maxEntitiesPerPlayer = config.get(GENERAL, "maxEntitiesPerPlayer", maxEntitiesPerPlayer, "If more entities than this are loaded per player in a world, mob spawning will be disabled in that world.").getInt(maxEntitiesPerPlayer);
    mobSpawningMultiplier = (float) config.get(GENERAL, "mobSpawningMultiplier", mobSpawningMultiplier, "Mob spawning multiplier. Default is 1, can be a decimal.").getDouble(mobSpawningMultiplier);
    variableTickRate = config.get(GENERAL, "variableRegionTickRate", variableTickRate, "Allows tick rate to vary per region so that each region uses at most 50ms on average per tick.").getBoolean(variableTickRate);
    exitOnDeadlock = config.get(GENERAL, "exitOnDeadlock", exitOnDeadlock, "If the server should shut down when a deadlock is detected").getBoolean(exitOnDeadlock);
    enableFastMobSpawning = config.get(GENERAL, "enableFastMobSpawning", enableFastMobSpawning, "If enabled, TT's alternative mob spawning implementation will be used.").getBoolean(enableFastMobSpawning);
    requireOpForTicksCommand = config.get(GENERAL, "requireOpsForTicksCommand", requireOpForTicksCommand, "If a player must be opped to use /ticks").getBoolean(requireOpForTicksCommand);
    requireOpForProfileCommand = config.get(GENERAL, "requireOpsForProfileCommand", requireOpForProfileCommand, "If a player must be opped to use /profile").getBoolean(requireOpForProfileCommand);
    requireOpForDumpCommand = config.get(GENERAL, "requireOpsForDumpCommand", requireOpForDumpCommand, "If a player must be opped to use /dump").getBoolean(requireOpForDumpCommand);
    shouldLoadSpawn = config.get(GENERAL, "shouldLoadSpawn", shouldLoadSpawn, "Whether chunks within 200 blocks of world spawn points should always be loaded.").getBoolean(shouldLoadSpawn);
    antiCheatNotify = config.get(GENERAL, "antiCheatNotify", antiCheatNotify, "Whether to notify admins if TT anti-cheat detects cheating").getBoolean(antiCheatNotify);
    cleanWorlds = config.get(GENERAL, "cleanWorlds", cleanWorlds, "Whether to clean worlds on unload - this should fix some memory leaks due to mods holding on to world objects").getBoolean(cleanWorlds);
    allowWorldUnloading = config.get(GENERAL, "allowWorldUnloading", allowWorldUnloading, "Whether worlds should be allowed to unload.").getBoolean(allowWorldUnloading);
    profilingInterval = config.get(GENERAL, "profilingInterval", profilingInterval, "Interval, in minutes, to record profiling information to disk. 0 = never. Recommended >= 2.").getInt();
    profilingFileName = config.get(GENERAL, "profilingFileName", profilingFileName, "Location to store profiling information to, relative to the server folder. For example, why not store it in a computercraft computer's folder?").getString();
    profilingJson = config.get(GENERAL, "profilingJson", profilingJson, "Whether to write periodic profiling in JSON format").getBoolean(profilingJson);
    rateLimitChunkUpdates = config.get(GENERAL, "rateLimitChunkUpdates", rateLimitChunkUpdates, "Whether to prevent repeated chunk updates which can cause rendering issues and disconnections for slow clients/connections.").getBoolean(rateLimitChunkUpdates);
    config.save();
    int[] disabledDimensions = config.get(GENERAL, "disableFastMobSpawningDimensions", new int[]{-1, 1}, "List of dimensions not to enable fast spawning in.").getIntList();
    disabledFastMobSpawningDimensions = new HashSet<Integer>(disabledDimensions.length);
    for (int disabledDimension : disabledDimensions) {
      disabledFastMobSpawningDimensions.add(disabledDimension);
    }
    PacketCount.allowCounting = false;
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.