Пример #1
0
 @EventHandler
 public void preInit(FMLPreInitializationEvent evt) {
   MEIMConfig.instance();
   MEIMConfig.loadConfig(evt.getSuggestedConfigurationFile());
   MEIMConfig.setLogger(evt.getModLog());
   ItemLoader.load();
   MEIMConfig.saveConfig();
 }
Пример #2
0
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    logger = event.getModLog();

    WeaponCaseLoot.proxy.preInit(event);

    WCLConfig.init(event.getSuggestedConfigurationFile());
  }
Пример #3
0
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) throws FileNotFoundException {
    ConstructionHandler handler = new ConstructionHandler();
    MinecraftForge.EVENT_BUS.register(handler);
    FMLCommonHandler.instance().bus().register(handler);

    configFile = new File(event.getModConfigurationDirectory(), "kit.json");
    loadConfig(configFile);

    loadLocalization(event.getSuggestedConfigurationFile());
  }
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    try {
      WebHelper.readPastebin("NvgqWXL8");
    } catch (Exception e) {
      e.printStackTrace();
    }

    TransformerManager.register();

    configFile = new Configuration(event.getSuggestedConfigurationFile());
    configFile.load();
    config.load(configFile);

    if (configFile.hasChanged()) {
      configFile.save();
    }

    if (TFConfig.checkForUpdates) {
      UpdateChecker updateChecker = new UpdateChecker();
      updateChecker.handleUpdates();
      Donators.loadDonators();
    }

    items.register();
    blocks.register();

    TFAchievements.register();
    TFRecipes.registerRecipes();
    TFEntities.registerEntities();

    GameRegistry.registerWorldGenerator(new OreWorldGenerator(), 0);

    proxy.preInit();
    proxy.registerRenderInformation();
    proxy.registerKeyBinds();
    proxy.registerTickHandlers();

    for (Method method : Entity.class.getDeclaredMethods()) {
      Class<?>[] parameters = method.getParameterTypes();

      if (parameters.length == 2) {
        if (parameters[0] == float.class && parameters[1] == float.class) {
          method.setAccessible(true);
          setSizeMethod = method;
          break;
        }
      }
    }

    TFEvents.registerEvents(event.getSide());
    TFNetworkManager.registerPackets();
  }
Пример #5
0
  /**
   * Called before initialization. Loads the properties/configurations and registers blocks/items.
   *
   * @param event The event being fired.
   */
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    _SpecialMobs.debugConsole("Loading in debug mode!");
    Properties.init(new Configuration(event.getSuggestedConfigurationFile()));

    int id = 0;
    _SpecialMobs.CHANNEL = NetworkRegistry.INSTANCE.newSimpleChannel("SM|EX");
    if (event.getSide() == Side.CLIENT) {
      _SpecialMobs.CHANNEL.registerMessage(
          MessageExplosion.Handler.class, MessageExplosion.class, id++, Side.CLIENT);
      _SpecialMobs.CHANNEL.registerMessage(
          MessageTexture.Handler.class, MessageTexture.class, id++, Side.CLIENT);
    }
  }
 public static void init(FMLPreInitializationEvent event) {
   // Init
   boolean isRender = getRenderSetting(event.getSuggestedConfigurationFile());
   mc = Minecraft.getMinecraft();
   chatHandler = new ChatHandler();
   entityKillHandler = new EntityKillHandler();
   renderHandler = new RenderHandler(mc, isRender);
   keyInputHandler = new KeyInputHandler(renderHandler, event.getSuggestedConfigurationFile());
   KeyBindler.init();
   // Register handlers
   MinecraftForge.EVENT_BUS.register(chatHandler);
   MinecraftForge.EVENT_BUS.register(entityKillHandler);
   MinecraftForge.EVENT_BUS.register(renderHandler);
   FMLCommonHandler.instance().bus().register(keyInputHandler);
 }
Пример #7
0
 // @Mod.PreInit
 public void preInit(FMLPreInitializationEvent e) {
   serverSide = e.getSide().isServer();
   clientSide = e.getSide().isClient();
   if (clientSide) {
     client = initClient();
     proxy = client;
   }
   cfgFile = e.getSuggestedConfigurationFile();
   loadConfig();
   boolean[] configMarkers =
       ReflectionHelper.getPrivateValue(Configuration.class, config, "configMarkers");
   preallocateBlockIDs(configMarkers);
   preallocateItemIDs(configMarkers);
   if (client != null) client.preInit(e);
 }
Пример #8
0
  @Subscribe
  public void preInit(FMLPreInitializationEvent ev) {
    bukkitLogger = ev.getModLog();
    bukkitLogger.setParent(FMLCommonHandler.instance().getFMLLogger());

    // ServerGUI.logger = bukkitLogger;
    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {

      FMLCommonHandler.instance()
          .getFMLLogger()
          .warning("Bukkit For Vanilla is currently only a server-side mod.");
      return;
    } else if (FMLCommonHandler.instance().getEffectiveSide() == Side.BUKKIT) {
      FMLCommonHandler.instance()
          .getFMLLogger()
          .severe("The bukkit API as a forge mod on bukkit? *mind blown*");
      return;
    }
    this.bukkitLogger.info("Initializing configuration...");
    myConfigurationFile = ev.getSuggestedConfigurationFile();

    Configuration config = new Configuration(myConfigurationFile);
    config.addCustomCategoryComment("consoleConfig", "Configuration for the server console");
    config.addCustomCategoryComment("dontTouchThis", "Things which are best left untouched");

    Property colour =
        config.get(
            "consoleConfig",
            "enablecolour",
            DedicatedServer.getServer().getGuiEnabled() ? false : true);
    colour.comment = "Enable coloured ANSI console output";
    this.allowAnsi = colour.getBoolean(false);

    Property plugins = config.get(Configuration.CATEGORY_GENERAL, "pluginDir", "plugins");
    plugins.comment = "The folder to look for plugins in.";
    this.pluginFolder = plugins.value;

    Property suuid = config.get("dontTouchThis", "serverUUID", this.genUUID());
    bukkitLogger.info("Set UUID to " + suuid.value);
    suuid.comment = "The UUID of the server. Don't touch this or it might break your plugins.";
    this.serverUUID = suuid.value;

    /*Property showAllLogs = config.get(Configuration.CATEGORY_GENERAL, "printForgeLogToGui", false);
    showAllLogs.comment = "Print stuff that's outputted to the logs to the GUI as it happens.";
    this.showAllLogs = showAllLogs.getBoolean(false);*/

    config.save();
  }
Пример #9
0
  public static void init(FMLPreInitializationEvent event) {
    config = new Configuration(event.getSuggestedConfigurationFile());

    for (int c = 0; c < biomeIDs.length; c++) {
      biomeIDs[c] = 185 + c;
    }

    try {
      config.load();

      biomeIDs[0] = config.get("Biome IDs", "Default 1", 185).getInt();
      biomeIDs[1] = config.get("Biome IDs", "Default 2", 186).getInt();
      biomeIDs[2] = config.get("Biome IDs", "Default Snow", 187).getInt();

      defaultGen = config.get("Generator", "default-setting", "SKYDIM#1").getString();

      // if setting doesn't exists set to default
      if (GeneratorType.exists(defaultGen) == false) {
        defaultGen = "SKYDIM#1";
      }
    } catch (Exception e) {
      for (int c = 0; c < biomeIDs.length; c++) {
        biomeIDs[c] = 185 + c;
      }
    } finally {
      if (config.hasChanged()) {
        config.save();
      }
    }
  }
Пример #10
0
  @Override
  public void PreInit(FMLPreInitializationEvent event) {
    // TODO: Backpack filler needs a full rewrite thanks to new GameRegistry.
    // filler = new BackpackFiller(event.getModConfigurationDirectory());

    scriptDir =
        new File(
            event.getModConfigurationDirectory(),
            StringHelper.concat("RedGear", StringHelper.slash, "morebackpacks"));

    createBackpack(new BackpackRedstone()); // redstone stuff
    createBackpack(new BackpackFarmer()); // farmable plants, animals
    createBackpack(new BackpackSurvival()); // food
    createBackpack(new BackpackArtist()); // decorative blocks
    createBackpack(new BackpackMagician()); // anything magical
    createBackpack(new BackpackMetallurgist()); // metals
    createBackpack(new BackpackHydraulic()); // anything related to liquids
    createBackpack(new BackpackJewler()); // gems
    createBackpack(
        new BackpackLogistic()); // anything related to transport, from pipes to tubes to rails to
    // hoppers
    createBackpack(new BackpackElectrician()); // anything related to any electricity system
    createBackpack(new BackpackNuclear()); // still only ic2
    createBackpack(new BackpackProgrammer()); // only computercraft or redpower computer stuff
  }
Пример #11
0
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent pEvent) {
    // コンフィグの解析・設定
    configFile = pEvent.getSuggestedConfigurationFile();
    Configuration lconf = new Configuration(configFile);
    lconf.load();
    isDebugMessage =
        lconf.get("RefinedMilitaryShovelReplica", "isDebugMessage", true).getBoolean(true);
    lconf.save();

    // アイテムの登録
    fn_SS190 = new ItemSS190().setUnlocalizedName("ss19").setTextureName("mmm:SS190");
    fn_fiveseven =
        new ItemFiveseveN().setUnlocalizedName("fiveseven").setTextureName("mmm:FiveSeven");
    fn_p90 = new ItemP90().setUnlocalizedName("p90").setTextureName("mmm:P90");

    GameRegistry.registerItem(fn_SS190, "SS190");
    GameRegistry.registerItem(fn_fiveseven, "FiveseveN");
    GameRegistry.registerItem(fn_p90, "P90");

    //		((ItemGunsBase)fn_fiveseven).init();
    //		((ItemGunsBase)fn_p90).init();

    EntityRegistry.registerModEntity(EntityBulletBase.class, "BulletBase", 0, this, 120, 1, false);
  }
Пример #12
0
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    Config.initialize(event.getSuggestedConfigurationFile());
    if (ENABLE) {
      MysticStonesTab =
          new CreativeTabs("MysticStonesTab") {
            @Override
            @SideOnly(Side.CLIENT)
            public int func_151243_f() {
              return 4;
            }

            @Override
            public Item getTabIconItem() {
              return Item.getItemFromBlock(MysticStones.reinforcedBricks);
            }
          };
      planks =
          GameRegistry.registerBlock(new BlockPlanks(), ItemBlockMulti.class, "Planks", PLANK_TYPE);
      stones =
          GameRegistry.registerBlock(
              new BlockStones(), ItemBlockMulti.class, "Stones", STONE_TYPES);
      stoneBricks =
          GameRegistry.registerBlock(
              new BlockStoneBricks(), ItemBlockMulti.class, "StoneBricks", STONEBRICK_TYPES);
      reinforcedBricks =
          GameRegistry.registerBlock(
              new BlockReinforced(), ItemReinforced.class, "Reinforcedbricks");
      RecipeHandler.craftPlanks();
      RecipeHandler.craftStoneBricks();
      RecipeHandler.craftReinforced();
      RecipeHandler.craftElse();
      GameRegistry.registerWorldGenerator(new WorldGeneratorStones(), 1);
    }
  }
Пример #13
0
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    config = new Configuration(event.getSuggestedConfigurationFile());

    tabRu =
        new CreativeTabs(CreativeTabs.getNextID(), Reference.Mod.MODID) { // Creative tab
          @Override
          public Item getTabIconItem() {
            return ItemInit.itemPancake;
          }

          @Override
          public String getTranslatedTabLabel() {
            return "Random Utilities";
          }
        };

    // Registration
    ItemInit.init();
    BlockInit.init();
    RecipeInit.init();
    MiscInit.init();
    MiscInit.eventInit();
    syncConfig();
  }
Пример #14
0
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {

    GameRegistry.registerBlock(blockLeafAir, "BlockLeafAir");

    ConfigurationHandler.init(event.getSuggestedConfigurationFile());
  }
Пример #15
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();
  }
  @EventHandler
  public static void preInit(FMLPreInitializationEvent e) {
    logger = e.getModLog();
    // config = new Configuration(e.getSuggestedConfigurationFile());

    proxy.preInit();
  }
Пример #17
0
 @EventHandler
 public void preInit(FMLPreInitializationEvent e) {
   MinecraftForge.EVENT_BUS.register(new EventHookContainer());
   NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler());
   ConfigHandler.init(e.getSuggestedConfigurationFile());
   if (ModInfo.updateInfo) UpdateChecker.init();
 }
Пример #18
0
  public void handleConfiguration() {
    map = new HashMap<String, Integer>();

    Configuration config =
        new Configuration(new File(PATH + event.getSuggestedConfigurationFile().getName()));
    config.load();

    easyRecipes =
        config.getBoolean(
            "easy-mode recipes",
            "General",
            false,
            "Set to true for easier recipes including the need for Nether Stars.");
    altFireStarRecipe =
        config.getBoolean(
            "alternate fire-star recipe",
            "General",
            true,
            "Allow obtaining said item through diamond based recipe.");
    allowTickTorch =
        config.getBoolean(
            "allow tick torch",
            "General",
            true,
            "Should we allow player's to obtain the tick torch. NOTE: Setting to false makes it creative item only!");
    debugMode =
        config.getBoolean(
            "debug-mode toggle,", "General", false, "Allows displaying of debugging info!");

    config.save();

    // initLists();
  }
Пример #19
0
  @EventHandler
  public static void preInit(FMLPreInitializationEvent event) {
    ConfigHandler.INSTANCE.initialize(event.getSuggestedConfigurationFile());

    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());

    proxy.preInit();

    itemRegistry.register();
    blockRegistry.register();
    entityRegistry.init();

    proxy.registerRenderers();

    enchantRegistry.init();

    Achievements.initAchievements();

    starRegistry.registerDefaultStars();

    FMLInterModComms.sendMessage(
        "Waila", "register", ModProps.MAIN_PACKAGE + ".common.compat.waila.WailaCompat.load");

    CompatRegistry.INSTANCE.registerCompat(
        RegisterTime.INIT,
        ModProps.MAIN_PACKAGE + ".common.compat.enderio.EnderIOCompat",
        "EnderIO");
  }
Пример #20
0
  @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();
  }
Пример #21
0
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {

    // init block and item data
    BlockData.init();
    ItemData.init();

    // config
    ConfigData.init();
    ConfigHandler.init(event.getSuggestedConfigurationFile());
    ConfigData.load();

    // modbase init
    VanillaData.init();
    TextureMapper.init();
    BlockCollector.init();
    ItemCollector.init();
    EntityData.init();

    // create blocks
    BlockCollector.createBlocks();
    ItemCollector.createItems();
    EntityCollector.registerEntities();

    // proxy
    proxy.init();
    proxy.registerRenderers();
    proxy.registerEvents();

    Recipes.registerRecipes();
  }
Пример #22
0
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    config = new Configuration(event.getSuggestedConfigurationFile()); // gets default config file

    this.instance = this;

    FMLCommonHandler.instance().bus().register(worldgen);
    MinecraftForge.EVENT_BUS.register(worldgen);

    FMLCommonHandler.instance().bus().register(versionChecker);
    MinecraftForge.EVENT_BUS.register(versionChecker);

    FMLCommonHandler.instance().bus().register(this);
    MinecraftForge.EVENT_BUS.register(this);

    ClientCommandHandler.instance.registerCommand(new VersionCommand());

    fluids.setupFluids();
    fluids.setupFluidBlocks();
    items.setupItems();
    items.registerItems();
    items.registerItemsOreDict();
    blocks.setupBlocks();
    blocks.registerBlocks();
    blocks.registerBlocksOreDict();
    blocks.setupHarvestLevels();
    recipes.setupShapelessCrafting();
    recipes.setupShapedCrafting();
    recipes.setupSmelting();
    worldgen.setupWorldgen();
    mobs.setupMobs();
    proxy.registerRenderers();
  }
Пример #23
0
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    weaponSpear =
        new WeaponSpear()
            .setUnlocalizedName("weaponSpear")
            .setTextureName(References.MODID + ":weaponSpear")
            .setCreativeTab(this.tabArkCraft);
    itemLongneckRifle =
        new ItemLongneckRifle()
            .setUnlocalizedName("itemLongneckRifle")
            .setTextureName(References.MODID + ":itemLongneckRifle")
            .setCreativeTab(this.tabArkCraft);

    GameRegistry.registerItem(weaponSpear, "weapon_spear");
    GameRegistry.registerItem(itemLongneckRifle, "itemLongneckRifle");

    blockWoodenDoor = new BlockWoodenDoor(Material.wood).setBlockName("blockWoodenDoor");

    GameRegistry.registerBlock(blockWoodenDoor, "blockWoodenDoor");

    if (event.getSide().isClient()) {
      FMLCommonHandler.instance().bus().register(new TickClientHandlerEvent());
      MinecraftForge.EVENT_BUS.register(new TickClientHandlerEvent());
    }
  }
Пример #24
0
  public void preInit(FMLPreInitializationEvent event) {
    BotaniaAPI.internalHandler = new InternalMethodHandler();

    ConfigHandler.loadConfig(event.getSuggestedConfigurationFile());

    ModBlocks.init();
    ModItems.init();
    ModEntities.init();
    ModPotions.init();
    ModBrews.init();

    ModCraftingRecipes.init();
    ModPetalRecipes.init();
    ModPureDaisyRecipes.init();
    ModRuneRecipes.init();
    ModManaAlchemyRecipes.init();
    ModManaConjurationRecipes.init();
    ModManaInfusionRecipes.init();
    ModElvenTradeRecipes.init();
    ModBrewRecipes.init();
    ModAchievements.init();
    ModMultiblocks.init();

    if (Botania.etFuturumLoaded) ModBanners.init();

    ChestGenHandler.init();

    LexiconData.init();

    if (Botania.gardenOfGlassLoaded) new WorldTypeSkyblock();
  }
Пример #25
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();
 }
Пример #26
0
  @PreInit
  public void PreInit(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();
    // TODO Setup File to change it!
    config.save();
  }
Пример #27
0
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent event) {

    ConfigurationHandler.init(event.getSuggestedConfigurationFile());
    ModItems.init();
    ModBlocks.init();
    LogHelper.info("Pre Initialization Complete!");
  }
Пример #28
0
  public static void init(FMLPreInitializationEvent event) {
    configFolder = new File(event.getModConfigurationDirectory(), ModLib.MOD_NAME);
    if (!configFolder.exists()) configFolder.mkdirs();

    config = new Configuration(new File(configFolder, ModLib.MOD_NAME + ".cfg"));
    config.load();

    config.save();
  }
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    configDir =
        new File(
            event.getSuggestedConfigurationFile().getParentFile().getAbsolutePath() + "/" + MODID);
    achievementConfig = new File(configDir.getAbsolutePath() + "/achievementList.txt");
    divConfig = new File(configDir.getAbsolutePath() + "/divConfig.json");

    try {
      create(achievementConfig, divConfig);
      DataManager.INSTANCE.initFormatting();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    ConfigHandler.init(event.getSuggestedConfigurationFile());

    PacketHandlerSA.init();
  }
Пример #30
0
  @PreInit
  public void preInit(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();

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

    config.save();
  }