Esempio n. 1
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();
    }
  }
Esempio n. 3
0
  @PreInit
  public void preInit(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();

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

    config.save();
  }
  public static void initConfig() {
    final File fileDir = new File(MetallurgyCore.proxy.getMinecraftDir() + "/config/Metallurgy3");
    fileDir.mkdir();
    final File cfgFile =
        new File(
            MetallurgyCore.proxy.getMinecraftDir() + "/config/Metallurgy3/MetallurgyMachines.cfg");

    try {
      cfgFile.createNewFile();
    } catch (final IOException e) {
      MetallurgyCore.log.info(e.getLocalizedMessage());
    }

    final Configuration config = new Configuration(cfgFile);

    crusherEnabled =
        config.get("1_enable.machines", "crusher", crusherEnabled).getBoolean(crusherEnabled);
    furnaceEnabled =
        config.get("1_enable.machines", "furnance", furnaceEnabled).getBoolean(furnaceEnabled);
    forgeEnabled =
        config.get("1_enable.machines", "smelter", forgeEnabled).getBoolean(forgeEnabled);
    abstractorEnabled =
        config
            .get("1_enable.machines", "abstractor", abstractorEnabled)
            .getBoolean(abstractorEnabled);
    chestEnabled = config.get("1_enable.machines", "chest", chestEnabled).getBoolean(chestEnabled);
    mintEnabled = config.get("1_enable.machines", "mint", mintEnabled).getBoolean(mintEnabled);
    enchanterEnabled =
        config.get("1_enable.machines", "enchanter", enchanterEnabled).getBoolean(enchanterEnabled);
    ladderEnabled =
        config.get("1_enable.machines", "ladder", ladderEnabled).getBoolean(ladderEnabled);
    pylonEnabled = config.get("1_enable.machines", "pylons", pylonEnabled).getBoolean(pylonEnabled);

    crusherID = config.getBlock("crusher", crusherID).getInt();
    furnaceID = config.getBlock("metal_furnace", furnaceID).getInt();
    forgeID = config.getBlock("smelter", forgeID).getInt();
    abstractorID = config.getBlock("abstractor", abstractorID).getInt();
    chestID = config.getBlock("precious_chest", chestID).getInt();
    mintID = config.getBlock("mint", mintID).getInt();
    mintStorageID = config.getBlock("mint_storage", mintStorageID).getInt();
    coloredGlassID = config.getBlock("colored_glass", coloredGlassID).getInt();
    lanternID = config.getBlock("lanterns", lanternID).getInt();
    ladderID = config.getBlock("ladders", ladderID).getInt();
    enchanterID = config.getBlock("enchanter", enchanterID).getInt();
    laserID = config.getBlock("miners_laser", laserID).getInt();
    xpTankID = config.getBlock("xp_tank", xpTankID).getInt();
    pylonID = config.getBlock("pylon", pylonID).getInt();

    coinID = config.getItem("coin", coinID).getInt();
    stackID = config.getItem("stack", stackID).getInt();
    coinBagID = config.getItem("coin_Bag", coinBagID).getInt();
    bullionID = config.getItem("Bullion", bullionID).getInt();
    goldCogID = config.getItem("gold_cog", goldCogID).getInt();
    glassDustID = config.getItem("glass_dust", glassDustID).getInt();
    orbID = config.getItem("fantasy_Orbs", orbID).getInt();
    sawDustID = config.getItem("saw_dust", sawDustID).getInt();

    tradesEnabled = config.get("Mint", "enable_trades", true).getBoolean(true);

    stoneCrusherSpeed =
        config.get("crusher_speeds", "stone", (int) (stoneCrusherSpeed * 1000)).getInt() / 1000F;
    copperCrusherSpeed =
        config.get("crusher_speeds", "copper", (int) (copperCrusherSpeed * 1000)).getInt() / 1000F;
    bronzeCrusherSpeed =
        config.get("crusher_speeds", "bronze", (int) (bronzeCrusherSpeed * 1000)).getInt() / 1000F;
    ironCrusherSpeed =
        config.get("crusher_speeds", "iron", (int) (ironCrusherSpeed * 1000)).getInt() / 1000F;
    steelCrusherSpeed =
        config.get("crusher_speeds", "steel", (int) (steelCrusherSpeed * 1000)).getInt() / 1000F;

    copperFurnaceSpeed =
        config.get("furnace_speeds", "copper", (int) (copperFurnaceSpeed * 1000)).getInt() / 1000F;
    bronzeFurnaceSpeed =
        config.get("furnace_speeds", "bronze", (int) (bronzeFurnaceSpeed * 1000)).getInt() / 1000F;
    ironFurnaceSpeed =
        config.get("furnace_speeds", "iron", (int) (ironFurnaceSpeed * 1000)).getInt() / 1000F;
    steelFurnaceSpeed =
        config.get("furnace_speeds", "steel", (int) (steelFurnaceSpeed * 1000)).getInt() / 1000F;

    extractorSpeeds[0] = config.get("abstractor", "speed_prometheum", 8).getInt();
    extractorSpeeds[1] = config.get("abstractor", "speed_deep_iron", 8).getInt();
    extractorSpeeds[2] = config.get("abstractor", "speed_block_steel", 7).getInt();
    extractorSpeeds[3] = config.get("abstractor", "speed_oureclase", 7).getInt();
    extractorSpeeds[4] = config.get("abstractor", "speed_aredrite", 6).getInt();
    extractorSpeeds[5] = config.get("abstractor", "speed_mithril", 6).getInt();
    extractorSpeeds[6] = config.get("abstractor", "speed_haderoth", 6).getInt();
    extractorSpeeds[7] = config.get("abstractor", "speed_orichalcum", 5).getInt();
    extractorSpeeds[8] = config.get("abstractor", "speed_adamantine", 5).getInt();
    extractorSpeeds[9] = config.get("abstractor", "speed_atlarus", 4).getInt();
    extractorSpeeds[10] = config.get("abstractor", "speed_tartarite", 4).getInt();

    xpBonus[0] = config.get("abstractor", "bonus_prometheum", 1.0).getDouble(1.0);
    xpBonus[1] = config.get("abstractor", "bonus_deep_iron", 1.1).getDouble(1.1);
    xpBonus[2] = config.get("abstractor", "bonus_black_steel", 1.2).getDouble(1.2);
    xpBonus[3] = config.get("abstractor", "bonus_oureclase", 1.3).getDouble(1.3);
    xpBonus[4] = config.get("abstractor", "bonus_aredrite", 1.4).getDouble(1.4);
    xpBonus[5] = config.get("abstractor", "bonus_mithril", 1.4).getDouble(1.4);
    xpBonus[6] = config.get("abstractor", "bonus_haderoth", 1.5).getDouble(1.5);
    xpBonus[7] = config.get("abstractor", "bonus_oreichalcum", 1.6).getDouble(1.6);
    xpBonus[8] = config.get("abstractor", "bonus_admantine", 1.7).getDouble(1.7);
    xpBonus[9] = config.get("abstractor", "bonus_atlarus", 1.8).getDouble(1.8);
    xpBonus[10] = config.get("abstractor", "bonus_tartarite", 2.0).getDouble(2.0);

    final String[] forgeNames = {
      "Ignatius",
      "Shadow Iron",
      "Shadow Steel",
      "Vyroxeres",
      "Inolashite",
      "Kalendrite",
      "Vulcanite",
      "Sanguinite"
    };
    for (int i = 0; i < 8; i++) {
      String forgeName = forgeNames[i].toLowerCase().trim().replace(" ", "_");
      forgeSpeeds[i] = config.get("forge.speeds", forgeName, forgeSpeeds[i]).getInt();
      forgeBuckets[i] = config.get("forge.buckets", forgeName, forgeBuckets[i]).getInt();
    }
    smelterDropsLava =
        config.get("forge", "drops_lava", smelterDropsLava).getBoolean(smelterDropsLava);

    if (config.hasChanged()) {
      config.save();
    }
  }
  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();
  }
  @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();
    }
  }
Esempio n. 7
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();
  }
 public int getBlockID(String blockID) {
   return idmConfiguration.getBlock("emcBlock", blockID, getNextBlockID()).getInt();
 }
Esempio n. 9
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();
  }
  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();
    }
  }