Package net.minecraftforge.common

Examples of net.minecraftforge.common.Configuration.load()


  }
 
  private void loadConfig(File f)
  {
    Configuration c = new Configuration(f);
    c.load();
   
    doUpdateCheck = c.get(Configuration.CATEGORY_GENERAL, "EnableUpdateCheck", true);
    doUpdateCheck.comment = "Set to false to disable update checks for all Power Crystals' mods.";
   
    c.save();
View Full Code Here


    NetworkRegistry.instance().registerGuiHandler(this, proxy);
    instance = this;

    // Config
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();

    // Items
    for (ItemEnum current : ItemEnum.values())
    {
      current.setID(config.getItem(current.getIDName() + "_ID", current.getID(), current.getDescription()).getInt());
View Full Code Here

  {
    Info.isDebugging = false;
    try
    {
      Configuration configuration = new Configuration(event.getSuggestedConfigurationFile());
      configuration.load();

      // Check for legacy configuration file
      File oldFile = new File(event.getModConfigurationDirectory(), "ChargingBench.cfg");
      boolean migrate = oldFile.exists();
      if (migrate)
View Full Code Here

          FMLLog.getLogger().info(Info.TITLE_LOG + "New config file already contains settings. Skipping migration.");
        }
        else
        {
          Configuration oldconfig = new Configuration(oldFile);
          oldconfig.load();
          blockIDAdvPwrMan = oldconfig.get(configuration.CATEGORY_BLOCK, "ChargingBench", blockIDAdvPwrMan).getInt();
          Info.isDebugging = (oldconfig.get(configuration.CATEGORY_GENERAL, "debug",  Info.isDebugging).getBoolean(Info.isDebugging));
          oldconfig.save();
          boolean success = oldFile.delete();
          if (success)
View Full Code Here

  }
 
  public static void loadCommonConfig(File configFile)
  {
    Configuration c = new Configuration(configFile);
    c.load();
    machineBlock0Id = c.getBlock("ID.MachineBlock", 3120);
    conveyorBlockId = c.getBlock("ID.ConveyorBlock", 3121);
    rubberWoodBlockId = c.getBlock("ID.RubberWood", 3122);
    rubberLeavesBlockId = c.getBlock("ID.RubberLeaves", 3123);
    rubberSaplingBlockId = c.getBlock("ID.RubberSapling", 3124);
View Full Code Here

  @PreInit
  public void preInit(FMLPreInitializationEvent event)
  {
    System.out.println("Initializing Colonies " + Version());
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    setConfig(config);
    config.save();
    MinecraftForge.EVENT_BUS.register(new ColoniesSoundManager());
    MinecraftForge.EVENT_BUS.register(new AncientTomeDropsEvent());
  }
View Full Code Here

    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);
View Full Code Here

  //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();
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();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.