Пример #1
0
 public static ItemStack getItemStackFromConfig(
     String modid, String category, String name, int stackSize, int metadata, boolean isItem) {
   Configuration config = configFiles.get(modid);
   if (config == null) {
     File configFile = null;
     if (modid.equalsIgnoreCase("buildcraft"))
       configFile = new File(Loader.instance().getConfigDir(), "buildcraft/main.conf");
     else if (modid.equalsIgnoreCase("EnderIO"))
       configFile = new File(Loader.instance().getConfigDir(), "enderio/EnderIO.conf");
     else configFile = new File(Loader.instance().getConfigDir(), modid + ".cfg");
     if (configFile != null && configFile.exists()) {
       config = new Configuration(configFile);
       config.load();
       configFiles.put(modid, config);
     } else return null;
   }
   if (config.hasKey(category, name)) {
     int id = config.get(category, name, -1).getInt();
     if (isItem && !modid.equals("immibis") && !modid.equals("foundry")) id += 256;
     if (id > 0 && id < 32768 && Item.itemsList[id] != null) {
       try {
         return new ItemStack(Item.itemsList[id], stackSize, metadata);
       } catch (Exception e) {
         e.printStackTrace();
         return null;
       }
     } else return null;
   } else return null;
 }
  @EventHandler // used in 1.6.2
  // @PreInit    // used in 1.5.2
  public void preInit(FMLPreInitializationEvent event) {
    // Stub Method
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();

    Property comment;
    jumpLimit = config.get("Vampire Configuration", "jumpLimit", 3.0).getDouble(3.0);
    comment = config.get("Vampire Configuration", "jumpLimit", 3.0);
    comment.comment =
        "A float on how high a vampire can reach. 1 = 100days = 15blocks. Default = 3";

    singleplayerRitual =
        config.get("Vampire Configuration", "singleplayerRitual", true).getBoolean(true);
    comment = config.get("Vampire Configuration", "singleplayerRitual", true);
    comment.comment = "Can you perform the original ritual alone? Default = true";

    allowOriginals = config.get("Vampire Configuration", "allowOriginals", true).getBoolean(true);
    comment = config.get("Vampire Configuration", "allowOriginals", true);
    comment.comment =
        "Are originals even allowed? Makes singleplayerRitual worthless if false. Default = true";

    useFoodBar = config.get("Vampire Configuration", "useFoodBar", true).getBoolean(true);
    comment = config.get("Vampire Configuration", "useFoodBar", true);
    comment.comment = "Should the food bar represent blood left. Default = true";
    // boolean = config.get("Vampire Configuration", "singleplayerRitual", true).getBoolean(true);

    suffocateOnly = config.get("Vampire Configuration", "suffocateOnly", true).getBoolean(true);
    comment = config.get("Vampire Configuration", "suffocateOnly", true);
    comment.comment =
        "In order to become a vampire after being fed blood does the player turn into a vampire with any death, or does the player need to suffocate in a wall to become a vampire? Default = true";

    config.save();
  }
Пример #3
0
  @PreInit
  public void preInit(FMLPreInitializationEvent evt) {
    // This is new! put stuff here that you want to happen before the mods are loaded
    Configuration config = new Configuration(evt.getSuggestedConfigurationFile());

    config.load();

    // Block Ids 3041 - 3060
    stonewallID = config.getBlock("Cobblestone Wall", 3041).getInt();
    stonebrickwallID = config.getBlock("Stonebrick Wall", 3042).getInt();
    crackedbrickwallID = config.getBlock("Cracked Stonebrick Wall", 3043).getInt();
    mossbrickwallID = config.getBlock("Mossy Stonebrick Wall", 3044).getInt();
    brickwallID = config.getBlock("Brick Wall", 3045).getInt();
    LapiswallID = config.getBlock("Lapis Wall", 3046).getInt();
    woodenwallID = config.getBlock("Wooden Wall", 3047).getInt();
    sandstonewallID = config.getBlock("Sandstone Wall", 3048).getInt();
    Stonebrick1ID = config.getBlock("Used for Texture 1", 3049).getInt();
    Stonebrick2ID = config.getBlock("Used for Texture 2", 3050).getInt();
    Stonebrick3ID = config.getBlock("Used for Texture 3", 3051).getInt();
    Stonebrick4ID = config.getBlock("Used for Texture  4", 3052).getInt();
    netherbrickID = config.getBlock("Nether Brick Wall", 3053).getInt();
    //    	 BloodstonebrickID = config.getBlock("Bloodstone brick Wall", 3054).getInt();

    config.save();
  }
Пример #4
0
 @Deprecated
 public static void initiate() {
   CONFIGURATION.load();
   USE_FUEL =
       CONFIGURATION
           .get(Configuration.CATEGORY_GENERAL, "Use Fuel", Settings.USE_FUEL)
           .getBoolean(Settings.USE_FUEL);
   LOAD_CHUNKS =
       Settings.CONFIGURATION
           .get(Configuration.CATEGORY_GENERAL, "Allow Chunk Loading", LOAD_CHUNKS)
           .getBoolean(LOAD_CHUNKS);
   DAO_DAN_ZUI_YUAN =
       Settings.CONFIGURATION
           .get(Configuration.CATEGORY_GENERAL, "Max Missile Distance", Settings.DAO_DAN_ZUI_YUAN)
           .getInt(Settings.DAO_DAN_ZUI_YUAN);
   ANTIMATTER_SIZE =
       Settings.CONFIGURATION
           .get(Configuration.CATEGORY_GENERAL, "Antimatter Explosion Size", ANTIMATTER_SIZE)
           .getInt(ANTIMATTER_SIZE);
   DESTROY_BEDROCK =
       Settings.CONFIGURATION
           .get(Configuration.CATEGORY_GENERAL, "Antimatter Destroy Bedrock", DESTROY_BEDROCK)
           .getBoolean(DESTROY_BEDROCK);
   MAX_ROCKET_LAUCNHER_TIER =
       Settings.CONFIGURATION
           .get(
               Configuration.CATEGORY_GENERAL,
               "Limits the max missile tier for rocket launcher item",
               MAX_ROCKET_LAUCNHER_TIER)
           .getInt(MAX_ROCKET_LAUCNHER_TIER);
   CONFIGURATION.save();
 }
  @Override
  public void forceLoad(ICommandSender sender) {
    OutputHandler.finer("Loading chatconfigs");
    config.load();

    chatFormat = config.get("Chat", "chatformat", "%prefix<%username>%suffix %white%message").value;

    Chat.censor = config.get("BannedWords", "censor", true).getBoolean(true);
    Chat.bannedWords =
        Arrays.asList(
            config.get("BannedWords", "censorList", new String[] {"f**k", "ass", "bitch", "shit"})
                .valueList);

    groupPrefixFormat =
        config.get(
                "Chat.groups",
                "groupPrefix",
                "{...<:>" + ZoneManager.getGLOBAL().getZoneName() + "}")
            .value;
    groupSuffixFormat =
        config.get(
                "Chat.groups",
                "groupSuffix",
                "{...<:>" + ZoneManager.getGLOBAL().getZoneName() + "}")
            .value;
    groupRankFormat =
        config.get("Chat.groups", "rank", "[{...<:>" + ZoneManager.getGLOBAL().getZoneName() + "}]")
            .value;
  }
  @Override
  public void forceLoad(ICommandSender sender) {
    config.load();

    String cat = "Snooper";

    ModuleSnooper.port = config.get(cat, "port", 25565, "The query port").getInt();
    ModuleSnooper.hostname = config.get(cat, "hostname", "", "The query hostname/IP").value;

    ModuleSnooper.autoReboot =
        config
            .get(
                cat,
                "autoReload",
                true,
                "Automatically reload the query system if a fatal error occurs")
            .getBoolean(true);
    ModuleSnooper.enable =
        config.get(cat, "enable", false, "This one is obvious, don't you think?").getBoolean(false);

    for (Response response : ResponseRegistry.getAllresponses()) {
      String subCat = cat + "." + response.getName();
      response.allowed =
          config
              .get(
                  subCat,
                  "enable",
                  true,
                  "If false, this response won't be allowed on this server.")
              .getBoolean(true);
      response.readConfig(subCat, config);
    }
    ModuleSnooper.startQuery();
  }
  @Override
  public void forceLoad(ICommandSender sender) {
    config.load();

    config.save();

    CommandRegistrar.commandConfigs(config);
  }
  @PreInit
  public void PreInit(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();
    // TODO Setup File to change it!
    config.save();
  }
Пример #9
0
 @PreInit
 public void preInit(FMLPreInitializationEvent event) {
   System.out.println("Initializing Chunk Analyzer " + Version());
   Configuration config = new Configuration(event.getSuggestedConfigurationFile());
   config.load();
   ChunkAnalyzerItemID = config.getBlock("ChunkAnalyzerItemID", 1200).getInt();
   config.save();
 }
  public static void init(File configFile) {

    configuration = new Configuration(configFile);

    try {
      configuration.load();

      /* General configs */
      ConfigurationSettings.DISPLAY_VERSION_RESULT =
          configuration
              .get(
                  CATEGORY_GENERAL,
                  ConfigurationSettings.DISPLAY_VERSION_RESULT_CONFIGNAME,
                  ConfigurationSettings.DISPLAY_VERSION_RESULT_DEFAULT)
              .getBoolean(ConfigurationSettings.DISPLAY_VERSION_RESULT_DEFAULT);
      ConfigurationSettings.LAST_DISCOVERED_VERSION =
          configuration
              .get(
                  CATEGORY_GENERAL,
                  ConfigurationSettings.LAST_DISCOVERED_VERSION_CONFIGNAME,
                  ConfigurationSettings.LAST_DISCOVERED_VERSION_DEFAULT)
              .getString();
      ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE =
          configuration
              .get(
                  CATEGORY_GENERAL,
                  ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE_CONFIGNAME,
                  ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE_DEFAULT)
              .getString();

      /* Item configs */
      ItemIds.HEART_GOLD =
          configuration
              .getItem(Strings.HEART_GOLD_NAME, ItemIds.HEART_GOLD_DEFAULT)
              .getInt(ItemIds.HEART_GOLD_DEFAULT);

      /* Block config */
      BlockIds.CHARGER =
          configuration
              .getBlock(Strings.CHARGER_NAME, BlockIds.CHARGER_DEFAULT)
              .getInt(BlockIds.CHARGER_DEFAULT);

      /* Item durability configs */
      ConfigurationSettings.HEART_GOLD_MAX_DURABILITY =
          configuration
              .get(
                  CATEGORY_DURABILITY,
                  ConfigurationSettings.HEART_GOLD_MAX_DURABILITY_CONFIGNAME,
                  ConfigurationSettings.HEART_GOLD_MAX_DURABILITY_DEFAULT)
              .getInt(ConfigurationSettings.HEART_GOLD_MAX_DURABILITY_DEFAULT);

    } catch (Exception e) {
      FMLLog.log(
          Level.SEVERE, e, Reference.MOD_NAME + " has had a problem loading its configuration");
    } finally {
      configuration.save();
    }
  }
Пример #11
0
  public static void set(String categoryName, String propertyName, String newValue) {

    configuration.load();
    if (configuration.getCategoryNames().contains(categoryName)) {
      if (configuration.getCategory(categoryName).containsKey(propertyName)) {
        configuration.getCategory(categoryName).get(propertyName).set(newValue);
      }
    }
    configuration.save();
  }
Пример #12
0
  @PreInit
  public void preInit(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();

    colorBrickBlockID = config.getBlock("colorBrickBlockID", 1555).getInt();

    config.save();
  }
  @PreInit
  public void preInit(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();

    testItemId =
        config.get(Configuration.CATEGORY_ITEM, "testItem", 500 - Reference.ITEM_ID_FIX).getInt();
    ctrlKey =
        config.get(Configuration.CATEGORY_GENERAL, "useControlKeyForGui", false).getBoolean(true);

    config.save();
  }
Пример #14
0
 public static void loadConf(FMLPreInitializationEvent event) {
   conf = new Configuration(event.getSuggestedConfigurationFile());
   conf.load();
   System.out.println("PumpkinHeads Mods [PumpkinAPI] - Loading Blocks Configuration");
   loadBlocksConf();
   System.out.println("PumpkinHeads Mods [PumpkinAPI] - Loading Items Configuration");
   loadItemsConf();
   System.out.println("PumpkinHeads Mods [PumpkinAPI] - Loading Other Configuration");
   loadExtraConf();
   conf.save();
   System.out.println("PumpkinHeads Mods [PumpkinAPI] - Configuration Loaded");
 }
  public idManager(FMLPreInitializationEvent event) {
    // idManager configuration
    idmConfigurationFile = new File(event.getModConfigurationDirectory(), "/emc/idManager.cfg");
    idmConfiguration = new Configuration(idmConfigurationFile);
    idmConfiguration.load();

    // Sub configuration
    subConfigurationFile = event.getSuggestedConfigurationFile();
    subConfiguration = new Configuration(subConfigurationFile);
    subConfiguration.load();

    // Current ID
    currentBlockID = idmConfiguration.get("idManager", "minBlockID", minBlockID + 1).getInt();
    currentItemID = idmConfiguration.get("idManager", "minItemID", minItemID + 1).getInt();
    currentBiomeID = idmConfiguration.get("idManager", "minBiomeID", minBiomeID + 1).getInt();
    currentEntityID = idmConfiguration.get("idManager", "minEntityID", minEntityID + 1).getInt();
    currentFoodID = idmConfiguration.get("idManager", "minFoodID", minFoodID + 1).getInt(2020);

    // Save configuration
    idmConfiguration.save();
    subConfiguration.save();
  }
Пример #16
0
 @Mod.PreInit
 public static void preInit(FMLPreInitializationEvent event) {
   // Config(Ayarlar)
   Configuration config = new Configuration(event.getSuggestedConfigurationFile());
   config.load();
   ItemID = config.get("Item:", "Base Item ID", 2789).getInt();
   BlockID = config.get("Block:", "Base Block ID", 901).getInt();
   x1 = config.get("Block:", "Pressure Machine Idle ID", 901 + 34).getInt();
   x2 = config.get("Block:", "Pressure Machine Runing ID", 901 + 35).getInt();
   BiomeBlockID = config.get("Biome:", "Biome Block ID", 250).getInt();
   BiomeID = config.get("Biome:", "Biome ID", 23).getInt();
   AchievementID = config.get("Achievement:", "Base Achievement ID", 2001).getInt();
   config.save();
 }
Пример #17
0
 @Mod.PreInit
 public void preinit(FMLPreInitializationEvent event) {
   Configuration cfgConfiguration = new Configuration(event.getSuggestedConfigurationFile());
   cfgConfiguration.load();
   giandSkeletonID =
       cfgConfiguration.get("giantskeletonid", Configuration.CATEGORY_GENERAL, 75).getInt();
   giantSpiderID =
       cfgConfiguration.get("giantspiderid", Configuration.CATEGORY_GENERAL, 76).getInt();
   giantEndermanID =
       cfgConfiguration.get("giantendermanid", Configuration.CATEGORY_GENERAL, 77).getInt();
   giantCreeperID =
       cfgConfiguration.get("giantcreeperid", Configuration.CATEGORY_GENERAL, 78).getInt();
   giantZombieID =
       cfgConfiguration.get("giantzombieid", Configuration.CATEGORY_GENERAL, 79).getInt();
   cfgConfiguration.save();
 }
Пример #18
0
 @PreInit
 public void preInit(FMLPreInitializationEvent event) {
   Configuration config = new Configuration(event.getSuggestedConfigurationFile());
   config.load();
   this.allowOps = config.get("Settings", "allowOps", true).getBoolean(true);
   this.createUsersRecords = config.get("Settings", "createUsersRecords", false).getBoolean(false);
   this.debug = config.get("Settings", "debug", false).getBoolean(false);
   config.save();
   this.permController = new PermissionsController();
   this.permHandler = new PermissionInvocationHandler();
   ArrayList<String> set = new ArrayList();
   for (ModContainer mod : Loader.instance().getActiveModList()) {
     if (!set.contains(mod.getSource().getAbsolutePath()))
       set.add(mod.getSource().getAbsolutePath());
   }
   for (String path : set) checkLoadedModForPermissionClass(new File(path));
 }
Пример #19
0
  public static void init(File configFile) {

    configuration = new Configuration(configFile);

    try {
      configuration.load();

      /* General configs */
      ConfigurationSettings.DISPLAY_VERSION_RESULT =
          configuration
              .get(
                  CATEGORY_GENERAL,
                  ConfigurationSettings.DISPLAY_VERSION_RESULT_CONFIGNAME,
                  ConfigurationSettings.DISPLAY_VERSION_RESULT_DEFAULT)
              .getBoolean(ConfigurationSettings.DISPLAY_VERSION_RESULT_DEFAULT);
      ConfigurationSettings.LAST_DISCOVERED_VERSION =
          configuration
              .get(
                  CATEGORY_GENERAL,
                  ConfigurationSettings.LAST_DISCOVERED_VERSION_CONFIGNAME,
                  ConfigurationSettings.LAST_DISCOVERED_VERSION_DEFAULT)
              .getString();
      ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE =
          configuration
              .get(
                  CATEGORY_GENERAL,
                  ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE_CONFIGNAME,
                  ConfigurationSettings.LAST_DISCOVERED_VERSION_TYPE_DEFAULT)
              .getString();

      // ItemIds.MINIUM_SHARD = configuration.getItem(Strings.MINIUM_SHARD_NAME,
      // ItemIds.MINIUM_SHARD_DEFAULT).getInt(ItemIds.MINIUM_SHARD_DEFAULT);

    } catch (Exception e) {
      FMLLog.log(
          Level.SEVERE, e, CoreRef.MOD_NAME + " has had a problem loading its configuration");
    } finally {
      configuration.save();
    }
  }
  @EventHandler
  public void preInit(FMLPreInitializationEvent evt) {
    Configuration config = new Configuration(evt.getSuggestedConfigurationFile());
    config.load();

    Property itemsList =
        config.get(
            Configuration.CATEGORY_GENERAL,
            "LightItems",
            "50,89=12,348=10,91,327,76=10,331=10,314=14");
    itemsList.comment =
        "Item IDs that shine light while held. Armor Items also work when worn. [ONLY ON YOURSELF]";
    itemsMap = new ItemConfigHelper(itemsList.getString(), 15);

    Property notWaterProofList =
        config.get(Configuration.CATEGORY_GENERAL, "TurnedOffByWaterItems", "50,327");
    notWaterProofList.comment =
        "Item IDs that do not shine light when held in water, have to be present in LightItems.";
    notWaterProofItems = new ItemConfigHelper(notWaterProofList.getString(), 1);

    config.save();
  }
Пример #21
0
 /** {@inheritDoc} */
 @PreInit
 public void preInit(FMLPreInitializationEvent event) {
   config = new Configuration(event.getSuggestedConfigurationFile());
   config.load();
   if (event.getSide() == Side.CLIENT) {
     // Creates the klaxon folder.
     klaxons = new File(event.getModConfigurationDirectory(), "klaxons");
     if (!klaxons.exists()) {
       klaxons.mkdirs();
     }
     FMLLog.log(MOD_ID, Level.INFO, "Folder %s", klaxons);
     // Loads client configuration.
     file = new File(config.get(Configuration.CATEGORY_GENERAL, "Klaxon", "").getString());
     // Loading and loaded klaxons.
     loadingKlaxons = new HashSet<String>();
     loadedKlaxons = new HashSet<String>();
   }
   // Loads shared configuration.
   klaxonId =
       config.get(Configuration.CATEGORY_ITEM, "Klaxon", klaxonDefaultId).getInt(klaxonDefaultId);
   config.save();
 }
Пример #22
0
  @PreInit
  public void preInit(FMLPreInitializationEvent event) {
    // Add Pre-Initialization code such as configuration loading
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();

    // Block ids
    blockHelloWorldId = config.getOrCreateBlockIdProperty("BlockHelloWorld", 160).getInt();
    blockFossilFuelPSActiveId =
        config.getOrCreateBlockIdProperty("BlockFossilFuelPSActive", 161).getInt();
    blockFossilFuelPSIdleId =
        config.getOrCreateBlockIdProperty("BlockFossilFuelPSIdle", 162).getInt();
    blockCableId = config.getOrCreateBlockIdProperty("BlockCable", 163).getInt();
    blockAccumulatorId = config.getOrCreateBlockIdProperty("BlockAccumulatorId", 164).getInt();

    // Renderer ids
    renderTypeCableId =
        RenderingRegistry
            .getNextAvailableRenderId(); // config.getOrCreateIntProperty("RenderTypeCable",
                                         // Configuration.CATEGORY_GENERAL, 20).getInt();

    config.save();
  }
Пример #23
0
 @PreInit
 public void preInit(FMLPreInitializationEvent event) {
   config = new Configuration(event.getSuggestedConfigurationFile());
   config.load();
   config.save();
 }
Пример #24
0
 /**
  * Has the server owner denied plugin metrics?
  *
  * @return true if metrics should be opted out of it
  */
 public boolean isOptOut() {
   // Reload the metrics file
   configuration.load();
   return configuration.get(Configuration.CATEGORY_GENERAL, "opt-out", false).getBoolean(false);
 }
  public static void loadCommonConfig(FMLPreInitializationEvent evt) {
    Configuration c = new Configuration(evt.getSuggestedConfigurationFile());
    c.load();
    radonBlockID = c.getBlock("ID of the Test Block", 1100);
    slimeBlockID = c.getBlock("ID of the Slime Block", 1101);
    cakeEmilyID = c.getBlock("ID of the Saturation Cake", 1102);
    slimeGlassID = c.getBlock("ID of Slimey Glass", 1103);
    infuserID = c.getBlock("ID of Infuser", 1104);
    flightID = c.getBlock("ID of Flight", 1105);
    antiFlightID = c.getBlock("ID of Anti-Flight", 1106);
    magicBlockID = c.getBlock("ID of Magic Ore", 1107);
    topStructureID = c.getBlock("ID of Top Magic Structure Block", 1108);

    // Start of Items
    artificialID =
        c.getItem(
            Configuration.CATEGORY_ITEM, "ID of all artificial items. (Uses Metadata)", 10000);
    silkInfID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of all infused silks. (Uses Metadata)", 10001);
    coresID = c.getItem(Configuration.CATEGORY_ITEM, "ID of the Cores. (Uses Metadata)", 10002);
    tangoID = c.getItem(Configuration.CATEGORY_ITEM, "ID of the Tango", 10003);
    regenRingID = c.getItem(Configuration.CATEGORY_ITEM, "ID of the Ring of Regeneration", 10004);
    saddleStirrupID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Saddle Stirrup", 10005);
    saddleSeatID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Saddle Seat", 10006);
    saddleFlapID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Saddle Flap", 10007);

    needleID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Needle", 10010);
    needleThreadedID = c.getItem(Configuration.CATEGORY_ITEM, "Threaded Needle", 10011);

    freeExpID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Mob Blood", 10013);
    uberChargeID = c.getItem(Configuration.CATEGORY_ITEM, "ID of \u00DCber Charge", 10014);
    readingTomeID = c.getItem(Configuration.CATEGORY_ITEM, "ID of the Manual", 10015);
    transChangerID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Transmucostian Tome", 10016);
    transCoinID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Tier 1 Transmucostian Coin", 10017);
    transCoin2ID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of Tier 2 Transmucostian Coin", 10018);
    transCoin3ID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of Tier 3 Transmucostian Coin", 10019);
    transCoin4ID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of Tier 4 Transmucostian Coin", 10020);
    transCoin5ID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of Tier 5 Transmucostian Coin", 10021);
    shinyThingID = c.getItem(Configuration.CATEGORY_ITEM, "ID to make you go slower", 10022);
    dullThingID = c.getItem(Configuration.CATEGORY_ITEM, "ID to make you go faster", 10023);
    waffleID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Waffle", 10024);
    swiftnessID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Jarred Bird", 10025);
    magicCoreID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Magic Core", 10026);
    swiftness2ID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Jarred Birds (Plural)", 10027);
    lieID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Creative XP", 10028);
    endTeleID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Endmote", 10029);
    excavatorID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Excavator", 10030);
    grinderID = c.getItem(Configuration.CATEGORY_ITEM, "ID of the Grinder", 10031);
    edibleSlimeID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Edible Slime", 10032);
    chocolateDropID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Chocolate Drop", 10033);
    chocolateBarID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Chocolate Bar", 10034);
    chocolateBucketID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Chocolate Bucket", 10035);

    chocolateWrapperID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of Chocolate Bar Wrapper", 10037);
    wrapperFragmentID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of Scrunched-Up Chocolate Bar Wrapper", 10038);

    chumStickID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Chum Stick (Hi, Emily!)", 10040);

    upID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Cloud Fall", 10045);
    readingTomeAltID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Reading Tome", 10046);
    dragonSwordID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Dragon Sword", 10047);
    dragonBreathID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Dragon Breath", 10048);
    dragonPickaxeID = c.getItem(Configuration.CATEGORY_ITEM, "ID of the Dragon Pickaxe", 10049);
    magicWandID = c.getItem(Configuration.CATEGORY_ITEM, "ID of Magic Wand", 10050);
    cyberItems1ID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of a load of items (Uses Metadata)", 10051);
    cheaterID = c.getItem(Configuration.CATEGORY_ITEM, "ID of the Convenience Tool", 10052);

    shootWitherID =
        c.getItem(Configuration.CATEGORY_ITEM, "ID of the Repurposed Wither Head", 10054);

    arrowThingID = c.getItem(Configuration.CATEGORY_ITEM, "ID of the Unnamed Arrow Device", 10056);
    c.save();
  }
  public static void initProperties(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();

    AltarID = config.getBlock("Altar", 2621).getInt();
    AltarBlockID = config.getBlock("Altar Building Block", 2622).getInt();
    SewingID = config.getBlock("Sewing", 2623).getInt();
    BloodID = config.getBlock("Blood", 2625).getInt();
    ScentBurnerID = config.getBlock("Scent Burner", 2626).getInt();
    ScentID = config.getBlock("Scent", 2627).getInt();

    BucketBloodID = config.getItem("BloodStationary", 2621).getInt();
    ScytheID = config.getItem("Scythe", 2622).getInt();
    ScytheBoneID = config.getItem("Bone Scythe", 2629).getInt();
    GenericItemID = config.getItem("item", "main items", 2623).getInt();
    NecronomiconID = config.getItem("item", "necronomicon", 2624).getInt();
    OrgansID = config.getItem("item", "organs", 2625).getInt();
    BodyPartID = config.getItem("item", "bodyparts", 2626).getInt();
    SpawnerID = config.getItem("item", "spawner", 2628).getInt();

    SearchMinionID = config.get("Entity", "Search for free Minion ID", true).getBoolean(true);
    MinionID =
        SearchMinionID
            ? EntityRegistry.findGlobalUniqueEntityId()
            : config.get("entity", "Minion ID", 123).getInt();
    SearchTeddyID = config.get("Entity", "Search for free Teddy ID", true).getBoolean(true);
    TeddyID =
        SearchTeddyID
            ? EntityRegistry.findGlobalUniqueEntityId()
            : config.get("entity", "Teddy ID", 124).getInt();
    SearchIsaacID = config.get("Entity", "Search for free Isaac ID", true).getBoolean(true);
    IsaacID =
        SearchIsaacID
            ? EntityRegistry.findGlobalUniqueEntityId()
            : config.get("entity", "Isaac ID", 125).getInt();
    SearchIsaacBloodID =
        config.get("Entity", "Search for free Isaac Blood ID", true).getBoolean(true);
    IsaacBloodID =
        SearchIsaacBloodID
            ? EntityRegistry.findGlobalUniqueEntityId()
            : config.get("entity", "Isaac Blood ID", 126).getInt();
    SearchIsaacBodyID =
        config.get("Entity", "Search for free Isaac Body ID", true).getBoolean(true);
    IsaacBodyID =
        SearchIsaacBodyID
            ? EntityRegistry.findGlobalUniqueEntityId()
            : config.get("entity", "Isaac Body ID", 127).getInt();
    SearchIsaacHeadID =
        config.get("Entity", "Search for free Isaac Head ID", true).getBoolean(true);
    IsaacHeadID =
        SearchIsaacHeadID
            ? EntityRegistry.findGlobalUniqueEntityId()
            : config.get("entity", "Isaac Head ID", 128).getInt();
    SearchNecroVillagerID =
        config.get("Entity", "Search for free Necro Villager ID", true).getBoolean(true);
    NecroVillagerID =
        SearchNecroVillagerID
            ? EntityRegistry.findGlobalUniqueEntityId()
            : config.get("entity", "Necro Villager ID", 129).getInt();

    IsaacsHeadID = config.getItem("armor", "Isaac's Severed Head", 2627).getInt();

    Christmas = config.get("rendering", "christmas hats", false).getBoolean(false);

    RenderSpecialScythe =
        config
            .get("special scythes (only for a select number of people)", "Other", true)
            .getBoolean(false);
    InitDuringPreInit = config.get("Init items during pre init", "Other", false).getBoolean(false);
    NecroVillagerID = config.get("NecroVillagerID", "Other", 666).getInt();

    if (config.hasChanged()) {
      config.save();
    }
  }
Пример #27
0
  public static void loadConfig(FMLPreInitializationEvent e) {
    Configuration config = new Configuration(e.getSuggestedConfigurationFile());
    config.load();

    Property dialler =
        config.getBlock("DialComputerID", 3745, "The Block ID for the Dialling Computer.");
    blockDiallerID = dialler.getInt();

    Property powerInterface =
        config.getBlock("PowerInterfaceID", 3746, "The BlockID for the Gate Power Interface.");
    blockPowererID = powerInterface.getInt();

    Property oreRegen = config.get("WorldGen", "OreRegen", false);
    regenOres = oreRegen.getBoolean(false);

    Property addOresToWorld = config.get("WorldGen", "AddOres", true);
    addOres = addOresToWorld.getBoolean(true);

    Property bcPowerFuel = config.get("Power Configuration", "BC Power per Fuel Value", 120);
    bcPower = bcPowerFuel.getInt();

    Property icPowerFuel = config.get("Power Configuration", "IC2 Power per Fuel Value", 300);
    icPower = icPowerFuel.getInt();

    Property fuelAmount =
        config.get("Power Configuration", "Fuel Values per Naquadah", 3 * 60 * 20);
    fuelAm = fuelAmount.getInt();

    Property maxOpenT = config.get("Gate Configuration", "Maximum open time (Minutes)", 38);
    maxOpen = maxOpenT.getInt();

    Property irisClear = config.get("Gate Configuration", "Iris kill clears inventory", true);
    irisKillClear = irisClear.getBoolean(true);

    Property gHard = config.get("Gate Configuration", "Can go through recieving gates", false);
    gateHardMode = !gHard.getBoolean(false);

    Property fHard = config.get("Gate Configuration", "Fuel is in hard mode", true);
    fuelHardMode = fHard.getBoolean(true);

    Property ring =
        config.getBlock("SGRingID", 3747, "The BlockID for the SG Ring and Chevron Blocks.");
    blockSGRingID = ring.getInt();

    Property base = config.getBlock("SGBaseID", 3748, "The BlockID for the SG Base Block.");
    blockSGBaseID = base.getInt();

    Property portal = config.getBlock("SGPortalID", 3749, "The BlockID for the SG Portal Block.");
    blockSGPortalID = portal.getInt();

    Property controller = config.getBlock("SGControlID", 3750, "The BlockID for the DHD.");
    blockSGControllerID = controller.getInt();

    Property oreNaquadah =
        config.getBlock("SGOreNaquadahID", 3751, "The BlockID for the Naquadah Ore.");
    blockOreNaquadahID = oreNaquadah.getInt();

    Property blockNaquadah =
        config.getBlock("SGNaquadahBlockID", 3752, "The BlockID for the Naquadah block.");
    blockNaquadahID = blockNaquadah.getInt();

    Property itemNaquadah =
        config.getItem("SGNaquadahID", 5501, "The ItemID for the Naquadah item.");
    itemNaquadahID = itemNaquadah.getInt();

    Property itemNaqIngot =
        config.getItem("SGNaqIngotID", 5502, "The ItemID for the Naquadah Ingot item.");
    itemNaqIngotID = itemNaqIngot.getInt();

    Property crystalCore =
        config.getItem("SGCrystalCoreID", 5503, "The ItemID for the Stargate Core Crystal.");
    itemCrystalCoreID = crystalCore.getInt();

    Property crystalControl =
        config.getItem(
            "SGCrystalControlID", 5504, "The ItemID for the Stargate Controller Crystal.");
    itemCrystalControlID = crystalControl.getInt();

    Property upgradesID =
        config.getItem("SGUpdatedsID", 5505, "The ItemID for the Stargate Upgrades.");
    itemUpgradesID = upgradesID.getInt();

    Property hardID = config.getItem("SGHardID", 5506, "The ItemID for Naquadriah.");
    itemHardID = hardID.getInt();

    config.save();
  }
  @PreInit
  public void preInit(FMLPreInitializationEvent event) {

    MinecraftForge.EVENT_BUS.register(this);
    MinecraftForge.EVENT_BUS.register(proxy);

    TickRegistry.registerScheduledTickHandler(new ForceFieldClientUpdatehandler(), Side.CLIENT);
    TickRegistry.registerScheduledTickHandler(new ForceFieldServerUpdatehandler(), Side.SERVER);

    MFFSconfig = new Configuration(event.getSuggestedConfigurationFile());
    event.getModMetadata().version = Versioninfo.curentversion();
    try {
      MFFSconfig.load();

      MFFSTab = new MFFSCreativeTab(CreativeTabs.getNextID(), "MFFS");

      Property zapperParticles =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "renderZapperParticles", true);
      zapperParticles.comment =
          "Set this to false to turn off the small smoke particles present around TouchDamage enabled ForceFields.";
      showZapperParticles = zapperParticles.getBoolean(true);

      Property monazitWorldAmount =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "MonazitOreWorldGen", 4);
      monazitWorldAmount.comment =
          "Controls the size of the ore node that Monazit Ore will generate in";
      MonazitOreworldamount = monazitWorldAmount.getInt(4);

      Property adminList =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "ForceFieldMaster", "nobody");
      adminList.comment = "Add users to this list to give them admin permissions";
      Admin = adminList.value;

      Property influencedByOther =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "influencedbyothermods", true);
      influencedByOther.comment = "Should MFFS be influenced by other mods. e.g. ICBM's EMP";
      influencedbyothermods = influencedByOther.getBoolean(true);

      Property ffRemoveWaterLavaOnly =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "forcefieldremoveonlywaterandlava", false);
      ffRemoveWaterLavaOnly.comment =
          "Should forcefields only remove water and lava when sponge is enabled?";
      forcefieldremoveonlywaterandlava = ffRemoveWaterLavaOnly.getBoolean(false);

      Property feTransportCost =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "forcefieldtransportcost", 10000);
      feTransportCost.comment = "How much FE should it cost to transport through a field?";
      forcefieldtransportcost = feTransportCost.getInt(10000);

      Property feFieldBlockCost =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "forcefieldblockcost", 1);
      feFieldBlockCost.comment = "How much upkeep FE cost a default ForceFieldblock per second";
      forcefieldblockcost = feFieldBlockCost.getInt(1);

      Property BlockCreateMod =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "forcefieldblockcreatemodifier", 10);
      BlockCreateMod.comment =
          "Energy need for create a ForceFieldblock (forcefieldblockcost*forcefieldblockcreatemodifier)";
      forcefieldblockcreatemodifier = BlockCreateMod.getInt(10);

      Property ffZapperMod =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "forcefieldblockzappermodifier", 2);
      ffZapperMod.comment = "Energy need multiplier used when the zapper option is installed";
      forcefieldblockzappermodifier = ffZapperMod.getInt(2);

      Property maxFFGenPerTick =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "forcefieldmaxblockpeerTick", 5000);
      maxFFGenPerTick.comment = "How many field blocks can be generated per tick?";
      forcefieldmaxblockpeerTick = maxFFGenPerTick.getInt(5000);

      Property fcWorkCycle =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "ForceciumWorkCylce", 250);
      fcWorkCycle.comment = "WorkCycle amount of Forcecium inside a Extractor";
      ForceciumWorkCylce = fcWorkCycle.getInt(250);

      Property fcCellWorkCycle =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "ForceciumCellWorkCylce", 230);
      fcCellWorkCycle.comment = "WorkCycle amount of Forcecium Cell inside a Extractor";
      ForceciumCellWorkCylce = fcCellWorkCycle.getInt(230);

      Property extractorPassFEGen =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "ExtractorPassForceEnergyGenerate", 10000);
      extractorPassFEGen.comment = "How many ForceEnergy generate per WorkCycle";
      ExtractorPassForceEnergyGenerate = extractorPassFEGen.getInt(10000);

      Property defStationKillCost =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "DefenceStationKillForceEnergy", 10000);
      defStationKillCost.comment = "How much FE does the AreaDefenseStation when killing someone";
      DefenceStationKillForceEnergy = defStationKillCost.getInt(10000);

      Property defStationSearchCost =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "DefenceStationSearchForceEnergy", 1000);
      defStationSearchCost.comment =
          "How much FE does the AreaDefenseStation when searching someone for contraband";
      DefenceStationSearchForceEnergy = defStationSearchCost.getInt(1000);

      Property defStationScannCost =
          MFFSconfig.get(Configuration.CATEGORY_GENERAL, "DefenceStationScannForceEnergy", 10);
      defStationScannCost.comment =
          "How much FE does the AreaDefenseStation when Scann for Targets (amount * range / tick)";
      DefenceStationScannForceEnergy = defStationScannCost.getInt(10);

      Property Adventuremap = MFFSconfig.get(Configuration.CATEGORY_GENERAL, "adventuremap", false);
      Adventuremap.comment =
          "Set MFFS to AdventureMap Mode Extractor need no Forcecium and ForceField have no click damage";
      adventuremap = Adventuremap.getBoolean(false);

      // Machines + Blocks
      MFFSForceEnergyConverter =
          new BlockConverter(
                  MFFSconfig.getBlock("MFFSForceEnergyConverter", DefaultProps.block_Converter_ID)
                      .getInt(DefaultProps.block_Converter_ID))
              .setBlockName("MFFSForceEnergyConverter");
      MFFSExtractor =
          new BlockExtractor(
                  MFFSconfig.getBlock("MFFSExtractor", DefaultProps.block_Extractor_ID)
                      .getInt(DefaultProps.block_Extractor_ID))
              .setBlockName("MFFSExtractor");
      MFFSMonazitOre =
          new BlockMonazitOre(
                  MFFSconfig.getBlock("MFFSMonazitOre", DefaultProps.block_MonazitOre_ID)
                      .getInt(DefaultProps.block_MonazitOre_ID))
              .setBlockName("MFFSMonazitOre");
      MFFSDefenceStation =
          new BlockAreaDefenseStation(
                  MFFSconfig.getBlock("MFFSDefenceStation", DefaultProps.block_DefenseStation_ID)
                      .getInt(DefaultProps.block_DefenseStation_ID))
              .setBlockName("MFFSDefenceStation");
      MFFSCapacitor =
          new BlockCapacitor(
                  MFFSconfig.getBlock("MFFSCapacitor", DefaultProps.block_Capacitor_ID)
                      .getInt(DefaultProps.block_Capacitor_ID))
              .setBlockName("MFFSCapacitor");
      MFFSProjector =
          new BlockProjector(
                  MFFSconfig.getBlock("MFFSProjector", DefaultProps.block_Projector_ID)
                      .getInt(DefaultProps.block_Projector_ID))
              .setBlockName("MFFSProjector");
      MFFSFieldblock =
          new BlockForceField(
              MFFSconfig.getBlock("MFFSFieldblock", DefaultProps.block_Field_ID)
                  .getInt(DefaultProps.block_Field_ID));
      MFFSSecurtyStorage =
          new BlockSecurtyStorage(
                  MFFSconfig.getBlock("MFFSSecurtyStorage", DefaultProps.block_SecureStorage_ID)
                      .getInt(DefaultProps.block_SecureStorage_ID))
              .setBlockName("MFFSSecurtyStorage");
      MFFSSecurtyStation =
          new BlockAdvSecurtyStation(
                  MFFSconfig.getBlock("MFFSSecurtyStation", DefaultProps.block_SecurityStation_ID)
                      .getInt(DefaultProps.block_SecurityStation_ID))
              .setBlockName("MFFSSecurtyStation");

      // Items
      MFFSProjectorFFDistance =
          new ItemProjectorFieldModulatorDistance(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorFFDistance",
                          DefaultProps.item_AltDistance_ID)
                      .getInt(DefaultProps.item_AltDistance_ID))
              .setItemName("itemProjectorFFDistance");
      MFFSProjectorFFStrenght =
          new ItemProjectorFieldModulatorStrength(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorFFStrength",
                          DefaultProps.item_AltStrength_ID)
                      .getInt(DefaultProps.item_AltStrength_ID))
              .setItemName("itemProjectorFFStrength");
      MFFSitemFocusmatix =
          new ItemProjectorFocusMatrix(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemPorjectorFocusmatrix",
                          DefaultProps.item_FocusMatrix_ID)
                      .getInt(DefaultProps.item_FocusMatrix_ID))
              .setItemName("itemPorjectorFocusmatrix");
      MFFSitemForcePowerCrystal =
          new ItemForcePowerCrystal(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemForcePowerCrystal",
                          DefaultProps.item_FPCrystal_ID)
                      .getInt(DefaultProps.item_FPCrystal_ID))
              .setItemName("itemForcePowerCrystal");
      MFFSitemForcicium =
          new ItemForcicium(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemForcicium",
                          DefaultProps.item_Forcicium_ID)
                      .getInt(DefaultProps.item_Forcicium_ID))
              .setItemName("itemForcicium");
      MFFSitemForcicumCell =
          new ItemForcicumCell(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemForcicumCell",
                          DefaultProps.item_ForciciumCell_ID)
                      .getInt(DefaultProps.item_ForciciumCell_ID))
              .setItemName("itemForcicumCell");

      // Modules
      MFFSProjectorTypdiagowall =
          new ItemProjectorModulediagonallyWall(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorModulediagonallyWall",
                          DefaultProps.item_ModDiag_ID)
                      .getInt(DefaultProps.item_ModDiag_ID))
              .setItemName("itemProjectorModulediagonallyWall");
      MFFSProjectorTypsphere =
          new ItemProjectorModuleSphere(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorTypsphere",
                          DefaultProps.item_ModSphere_ID)
                      .getInt(DefaultProps.item_ModSphere_ID))
              .setItemName("itemProjectorTypsphere");
      MFFSProjectorTypkube =
          new ItemProjectorModuleCube(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorTypkube",
                          DefaultProps.item_ModCube_ID)
                      .getInt(DefaultProps.item_ModCube_ID))
              .setItemName("itemProjectorTypkube");
      MFFSProjectorTypwall =
          new ItemProjectorModuleWall(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorTypwall",
                          DefaultProps.item_ModWall_ID)
                      .getInt(DefaultProps.item_ModWall_ID))
              .setItemName("itemProjectorTypwall");
      MFFSProjectorTypdeflector =
          new ItemProjectorModuleDeflector(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorTypdeflector",
                          DefaultProps.item_ModDeflector_ID)
                      .getInt(DefaultProps.item_ModDeflector_ID))
              .setItemName("itemProjectorTypdeflector");
      MFFSProjectorTyptube =
          new ItemProjectorModuleTube(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorTyptube",
                          DefaultProps.item_ModTube_ID)
                      .getInt(DefaultProps.item_ModTube_ID))
              .setItemName("itemProjectorTyptube");
      MFFSProjectorTypcontainment =
          new ItemProjectorModuleContainment(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorModuleContainment",
                          DefaultProps.item_ModContainment_ID)
                      .getInt(DefaultProps.item_ModContainment_ID))
              .setItemName("itemProjectorModuleContainment");
      MFFSProjectorTypAdvCube =
          new ItemProjectorModuleAdvCube(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorModuleAdvCube",
                          DefaultProps.item_ModAdvCube_ID)
                      .getInt(DefaultProps.item_ModAdvCube_ID))
              .setItemName("itemProjectorModuleAdvCube");

      // Options
      MFFSProjectorOptionZapper =
          new ItemProjectorOptionTouchDamage(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemupgradeprozapper",
                          DefaultProps.item_OptTouchHurt_ID)
                      .getInt(DefaultProps.item_OptTouchHurt_ID))
              .setItemName("itemupgradeprozapper");
      MFFSProjectorOptionSubwater =
          new ItemProjectorOptionSponge(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemupgradeprosubwater",
                          DefaultProps.item_OptSponge_ID)
                      .getInt(DefaultProps.item_OptSponge_ID))
              .setItemName("itemupgradeprosubwater");
      MFFSProjectorOptionDome =
          new ItemProjectorOptionFieldManipulator(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemupgradeprodome",
                          DefaultProps.item_OptManipulator_ID)
                      .getInt(DefaultProps.item_OptManipulator_ID))
              .setItemName("itemupgradeprodome");
      MFFSProjectorOptionCutter =
          new ItemProjectorOptionBlockBreaker(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemUpgradeprocutter",
                          DefaultProps.item_OptBlockBreaker_ID)
                      .getInt(DefaultProps.item_OptBlockBreaker_ID))
              .setItemName("itemUpgradeprocutter");
      MFFSProjectorOptionDefenceStation =
          new ItemProjectorOptionDefenseStation(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorOptiondefencestation",
                          DefaultProps.item_OptDefense_ID)
                      .getInt(DefaultProps.item_OptDefense_ID))
              .setItemName("itemProjectorOptiondefencestation");
      MFFSProjectorOptionMoobEx =
          new ItemProjectorOptionMobDefence(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorOptionMoobEx",
                          DefaultProps.item_OptMobDefense_ID)
                      .getInt(DefaultProps.item_OptMobDefense_ID))
              .setItemName("itemProjectorOptionMoobEx");
      MFFSProjectorOptionForceFieldJammer =
          new ItemProjectorOptionForceFieldJammer(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorOptionFFJammer",
                          DefaultProps.item_OptJammer_ID)
                      .getInt(DefaultProps.item_OptJammer_ID))
              .setItemName("itemProjectorOptionFFJammer");
      MFFSProjectorOptionCamouflage =
          new ItemProjectorOptionCamoflage(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorOptionCamoflage",
                          DefaultProps.item_OptCamouflage_ID)
                      .getInt(DefaultProps.item_OptCamouflage_ID))
              .setItemName("itemProjectorOptionCamoflage");
      MFFSProjectorOptionFieldFusion =
          new ItemProjectorOptionFieldFusion(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemProjectorOptionFieldFusion",
                          DefaultProps.item_OptFusion_ID)
                      .getInt(DefaultProps.item_OptFusion_ID))
              .setItemName("itemProjectorOptionFieldFusion");

      // Cards
      MFFSitemcardempty =
          new ItemCardEmpty(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemcardempty",
                          DefaultProps.item_BlankCard_ID)
                      .getInt(DefaultProps.item_BlankCard_ID))
              .setItemName("itemcardempty");
      MFFSitemfc =
          new ItemCardPowerLink(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM, "itemfc", DefaultProps.item_CardPowerLink_ID)
                      .getInt(DefaultProps.item_CardPowerLink_ID))
              .setItemName("itemfc");
      MFFSItemIDCard =
          new ItemCardPersonalID(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemIDCard",
                          DefaultProps.item_CardPersonalID_ID)
                      .getInt(DefaultProps.item_CardPersonalID_ID))
              .setItemName("itemIDCard");
      MFFSItemSecLinkCard =
          new ItemCardSecurityLink(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemSecLinkCard",
                          DefaultProps.item_CardSecurityLink_ID)
                      .getInt(DefaultProps.item_CardSecurityLink_ID))
              .setItemName("itemSecLinkCard");
      MFFSitemInfinitePowerCard =
          new ItemCardPower(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemInfinitePower",
                          DefaultProps.item_infPowerCard_ID)
                      .getInt(DefaultProps.item_infPowerCard_ID))
              .setItemName("itemInfPowerCard");
      MFFSAccessCard =
          new ItemAccessCard(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemAccessCard",
                          DefaultProps.item_CardAccess_ID)
                      .getInt(DefaultProps.item_CardAccess_ID))
              .setItemName("itemAccessCard");

      // MultiTools
      MFFSitemWrench =
          new ItemWrench(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM, "itemWrench", DefaultProps.item_MTWrench_ID)
                      .getInt(DefaultProps.item_MTWrench_ID))
              .setItemName("itemWrench");
      MFFSitemSwitch =
          new ItemSwitch(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM, "itemSwitch", DefaultProps.item_MTSwitch_ID)
                      .getInt(DefaultProps.item_MTSwitch_ID))
              .setItemName("itemSwitch");
      MFFSitemFieldTeleporter =
          new ItemFieldtransporter(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemForceFieldsync",
                          DefaultProps.item_MTFieldTransporter_ID)
                      .getInt(DefaultProps.item_MTFieldTransporter_ID))
              .setItemName("itemForceFieldsync");
      MFFSitemMFDidtool =
          new ItemPersonalIDWriter(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "ItemMFDIDwriter",
                          DefaultProps.item_MTIDWriter_ID)
                      .getInt(DefaultProps.item_MTIDWriter_ID))
              .setItemName("ItemMFDIDwriter");
      MFFSitemMFDdebugger =
          new ItemDebugger(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemMFDdebugger",
                          DefaultProps.item_MTDebugger_ID)
                      .getInt(DefaultProps.item_MTDebugger_ID))
              .setItemName("itemMFDdebugger");
      MFFSitemManuelBook =
          new ItemManuelBook(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemManuelBook",
                          DefaultProps.item_MTManual_ID)
                      .getInt(DefaultProps.item_MTManual_ID))
              .setItemName("itemManuelBook");

      // Upgrades
      MFFSitemupgradeexctractorboost =
          new ItemExtractorUpgradeBooster(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemextractorbooster",
                          DefaultProps.item_upgradeBoost_ID)
                      .getInt(DefaultProps.item_upgradeBoost_ID))
              .setItemName("itemextractorbooster");
      MFFSitemupgradecaprange =
          new ItemCapacitorUpgradeRange(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemupgradecaprange",
                          DefaultProps.item_upgradeRange_ID)
                      .getInt(DefaultProps.item_upgradeRange_ID))
              .setItemName("itemupgradecaprange");
      MFFSitemupgradecapcap =
          new ItemCapacitorUpgradeCapacity(
                  MFFSconfig.getItem(
                          Configuration.CATEGORY_ITEM,
                          "itemupgradecapcap",
                          DefaultProps.item_upgradeCap_ID)
                      .getInt(DefaultProps.item_upgradeCap_ID))
              .setItemName("itemupgradecapcap");

    } catch (Exception e) {
      FMLLog.log(
          Level.SEVERE, e, "ModularForceFieldSystem has a problem loading it's configuration");
      System.out.println(e.getMessage());
    } finally {
      MFFSconfig.save();
    }
  }
  public static void makeConfig(File configFile) {
    configFileName = configFile.getName();
    final String CATEGORY_CORE = "Core";
    final String CATEGORY_RANK = "Ranks";
    final String CATEGORY_REGIONS = "Regions";
    final String CATEGORY_MESSAGES = "Messages";
    final String CATEGORY_OVERRIDE = "OverrideClasses";
    final String CATEGORY_MODULES = "Modules";

    Configuration configuration = new Configuration(configFile);
    System.out.println("Path: " + configFile.getAbsolutePath());
    try {
      configuration.load();
      Property prop;

      // CORE CONFIG
      prop = configuration.get(CATEGORY_CORE, "postModlist", true);
      prop.comment = "Make a file that conatains all the mods with version and URL.";
      postModlist = prop.getBoolean(true);

      prop = configuration.get(CATEGORY_CORE, "postLocation", "mods.txt");
      prop.comment = "Use / as seperator.";
      postLocation = prop.value;

      prop = configuration.get(CATEGORY_CORE, "spawnOverride", true);
      prop.comment =
          "When a player repsawns to the server spawn, override the location to allow 1 block specific spawn zone. Use setspawn to set the spawn, you can specify ranks for different spawn per rank.";
      spawnOverride = prop.getBoolean(true);

      prop = configuration.get(CATEGORY_CORE, "tap-makeup", "%Rc[%Rn]%U");
      prop.comment =
          "%U = username ; %Hn = Health numaric ; %Rn = rankname ; %Rc = ranks color ; Request MOAR @ ssm.dries007.net";
      VanillaInterface.tapMakeup = prop.value;

      // EXTRA COMMANDS
      prop = configuration.get(Configuration.CATEGORY_GENERAL, "TPAtimeout", 20);
      tpaTimeout = prop.getInt();

      // RANKS
      prop = configuration.get(CATEGORY_RANK, "defaultRank", "Guest");
      prop.comment = "Default rank";
      Permissions.defaultRank = prop.value;

      prop = configuration.get(CATEGORY_RANK, "opRank", "Admin");
      prop.comment = "Name of the OP rank";
      Permissions.opRank = prop.value;

      // MESSAGES
      prop = configuration.get(CATEGORY_MESSAGES, "wbMessage", "World ends here");
      prop.comment = null;
      WorldBorder.wbMessage = prop.value;

      prop = configuration.get(CATEGORY_MESSAGES, "PingMsg", "Pong!");
      prop.comment = "Response to the Ping Command";
      pingMsg = prop.value;

      // REGIONS
      prop = configuration.get(CATEGORY_REGIONS, "itemWandId", 900);
      prop.comment = "Id for the Wand";
      itemWandID = prop.getInt();

      prop = configuration.get(CATEGORY_REGIONS, "maxChanges", 500000);
      prop.comment = "The maximum amount of blocks that can be edited at once.";
      API.maxChanges = prop.getInt();

      prop = configuration.get(CATEGORY_REGIONS, "warningLevel", 100000);
      prop.comment =
          "If this amount of blocks (or more) is edited, a server wide message will be sent.";
      API.warningLevel = prop.getInt();

      prop = configuration.get(CATEGORY_REGIONS, "vertLevel", 128);
      prop.comment =
          "The hight a selection will be set at using vert or up. Setting this to 256 will make more lagg but makes editing large things easier.";
      API.vertLevel = prop.getInt();

      prop = configuration.get(CATEGORY_REGIONS, "bedrockRemoval", false);
      prop.comment = "Set this to true to make selections select layer 0 when using vert or down.";
      API.bedrockRemoval = prop.getBoolean(false);

      prop = configuration.get(CATEGORY_REGIONS, "secureTNT", true);
      prop.comment =
          "Calculate every block destroyed in the blast, laggy. If false, you only calculate the explosion source position.";
      API.secureTNT = prop.getBoolean(true);

      // MODULES
      prop = configuration.get(CATEGORY_RANK, "addCore", true);
      prop.comment = "Add Core commands";
      addCore = prop.getBoolean(true);

      prop = configuration.get(CATEGORY_RANK, "addExtra", true);
      prop.comment = "Add Extra commands";
      addExtra = prop.getBoolean(true);

      prop = configuration.get(CATEGORY_RANK, "addRegions", true);
      prop.comment = "Add Regions commands";
      addRegions = prop.getBoolean(true);

      // OVERRIDES
      for (String name : SimpleModsTransformer.override.keySet()) {
        prop = configuration.get(CATEGORY_OVERRIDE, name, true);
        prop.comment = SimpleModsTransformer.override.get(name);

        if (prop.getBoolean(true)) {
          SimpleModsTransformer.override.put(name, prop.comment);
        } else {
          SimpleModsTransformer.override.remove(name);
        }
      }
    } catch (Exception e) {
      System.out.println("SimpleMods has a problem loading it's configuration");
      System.out.println(e.getMessage());
      throw new RuntimeException();
    } finally {
      configuration.save();
    }
  }