Java 类cpw.mods.fml.common.Mod.PreInit 实例源码

项目:Apocalyptic    文件:Apocalyptic.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    apLogger.setParent(FMLLog.getLogger());

    apLogger.info("[Apocalyptic] Starting pre-initialization");
    apLogger.info("[Apocalyptic] Loading configuration");

    isServer = event.getSide().isServer();

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

    tePerChunk = config.get("general", "TileEntitiesPerChunk", 900).getInt(900);
    silverfishChance = config.get("general", "SilverfishSpawnChance", 0.001).getDouble(0.001);
    transferLimit = config.get("transfer", "limit", new String[]{"0:0:0", "1:X:1"}).getStringList();
    transferTagRemove = config.get("transfer", "tag-remove", new String[]{"0:0", "1:X"}).getStringList();
    //databaseURL = config.get("database", "URL", "jdbc:mysql://site.ru:3306/database").getString();
    //databaseUsername = config.get("database", "Username", "Username").getString();
    //databasePassword = config.get("database", "Password", "Password").getString();

    config.load();
    config.save();

    this.initCustomPotions(event);

    apLogger.info("[Apocalyptic] Pre-initialization completed");
}
项目:UrbanCraft-KnownPlayers    文件:KnownPlayers.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    logger = Logger.getLogger(ID);
    logger.setParent(FMLLog.getLogger());

    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    post_url = config.get(config.CATEGORY_GENERAL, "post_url", "http://localhost/post/", "This is the url of which the mod posts updates to.").value;
    identifier = config.get(config.CATEGORY_GENERAL, "identifier", "knownplayers", "This string determines the value of the id field in the post request.").value;
    debug = config.get(Configuration.CATEGORY_GENERAL, "debug", false, "Enable debuging?").getBoolean(true);

    event_login = config.get("event", "login", true, "Send POST on player login?").getBoolean(true);
    event_logout = config.get("event", "logout", true, "Send POST on player logout?").getBoolean(true);
    event_respawn = config.get("event", "respawn", true, "Send POST on player respawn?").getBoolean(true);
    event_changedimension = config.get("event", "changedimension", true, "Send POST when player changes world?").getBoolean(true);

    config.save();

    logger.info("debug: " + debug);
    logger.info("identifier: " + identifier);
    logger.info("post_url: " + post_url);
    logger.info("event_login: " + event_login);
    logger.info("event_logout: " + event_logout);
    logger.info("event_respawn: " + event_respawn);
    logger.info("event_changedimension: " + event_changedimension);
}
项目:Oilcraft    文件:Oilcraft.java   
@PreInit
public void preLoad(FMLPreInitializationEvent event) {
    NetworkRegistry.instance().registerGuiHandler(this, this.proxy);

    Configuration conf = new Configuration(
            new File(Loader.instance().getConfigDir(), "OilCraft.cfg"));

    conf.load();

    OilGenerator.makeInstance(
            conf.get("blocks", "Oil_Generator", 500).getInt(), 0);
    int stillId = conf.get("blocks", "Oil_Still", 601).getInt();
    OilStill.makeInstance(stillId, 7);
    // Minecraft makes the silly assumption that the block Id of the flow
    // version of a liquid is 1 less than the still version of that same
    // liquid. In this way it can build a connection between the two blocks
    // so they can spawn each other.
    OilFlow.makeInstance(stillId - 1, 7);

    conf.save();

    proxy.preInit();
}
项目:LEDLights    文件:LEDLights.java   
@PreInit
public void preInit(FMLPreInitializationEvent event){

    // super Log Helper init for LEDLights
    LogHelper.init();

    // Load config to get our IDs and so
    ConfigHandler.init(event.getSuggestedConfigurationFile());

    // Loading blocks
    ModBlocks.init();
    ModItems.init();

    ModCrafting.init();

    ClientProxy.setCustomRenderers();
}
项目:Mythical-Gods-Mod    文件:MythicalGods.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    // Register the Sound Handler (Client only)
    MinecraftForge.EVENT_BUS.register(new SoundHandler());
    // Initialize the log helper
    LogHelper.init();
    // Initialize the Blocks and Items
    BlockHelper.init();
    ItemHelper.init();
    // Initialize the Recipes and Dungeon loot
    RecipeHelper.init();
    LootHelper.init();
    // Register the OreGenerator
    GameRegistry.registerWorldGenerator(new OreWorldGeneratorEnd());
    GameRegistry.registerWorldGenerator(new OreWorldGeneratorOverWorld());
    GameRegistry.registerWorldGenerator(new OreWorldGeneratorNether());
    // Initialize the CapeHelper
    CapeHelper.init();
    // Initialize the Entitys
    EntityHelper.init();

    // Set the name for the creative tab
    LanguageRegistry.instance().addStringLocalization("itemGroup." + Reference.MOD_ID, "Mythical Gods Mod");
}
项目:Fuelsmod    文件:FuelsMod.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {

    PaleoPacketHandler.registerChannel();
    proxy.registerRenders();
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath()
            + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID
            + ".cfg"));
    LocalizationHandler.loadLanguages();
    ModItem.init();
    ModBlock.init();

    proxy.PreInitRenders();
    WorkTableCogHelper.initRecipes();
    MixingTableHelper.initRecipes();
    ModLoaded.PreInit_modloaded();

}
项目:QuestCraft    文件:QuestCraft.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    // TODO: Read configuration files for blocks and items
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());

    config.load();

    //someConfigFlag = Boolean.parseBoolean(config.get(ConfigCategory_Generic, "someConfig", "true").value);
    config.addCustomCategoryComment(ConfigCategory_Generic, "All generic settings for questcraft");
    Property someConfig = config.get(ConfigCategory_Generic, "someConfig", "true");
    someConfig.comment = "Configure some configuration setting (true/false). Default true";
    someConfigFlag = someConfig.getBoolean(true);

    Property questInstanceItemIDProperty = config.get(ConfigCategory_Generic, "quest-instance-item-id", "5000");
    questInstanceItemIDProperty.comment = "Item ID used for quest instance items";
    questInstanceItemID = questInstanceItemIDProperty.getInt(5000);

    config.save();
}
项目:Eldritch-Infusion    文件:EI.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    // Initialize localization
    LocalizationHandler.loadLanguages();

    // Initialize the configuration file
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg"));

    // Initialize WorldGen
    GameRegistry.registerWorldGenerator(new WorldGeneratorEI());

    ModBlocks.init(); // Initialize blocks
    ModItems.init();  // Initialize items
    ModOres.init();   // Initialize ores
    ModBiomes.init(); // Initialize Biomes
    ModWorlds.init(); // Initialize Dimension
    ModRecipes.init(); //initialize recipes
}
项目:AltEnergy    文件:AltEnergy.java   
/**
 * This is were you load up blocks/items
 * 
 * @param event
 */
@PreInit
public void preInit(FMLPreInitializationEvent event) {

    log(Level.INFO, "PreInitializing " + Reference.MOD_ID + " version: " + meta.version);

    LocalizationHandler.loadLanguages();

    // Initialize the configuration
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator
            + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg"));

    ModBlocks.init();
    ModItems.init();
    ModContent.init();

    GameRegistry.registerWorldGenerator(genManager);

    NetworkRegistry.instance().registerGuiHandler(this, proxy);
}
项目:paleocraft    文件:PaleoCraft.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    LocalizationHandler.loadLanguages();
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
            .getAbsolutePath()
            + File.separator
            + Reference.CHANNEL_NAME
            + File.separator + Reference.MOD_ID + ".cfg"));
    // Initialize mod blocks
    ModBlocks.init();

    // Initialize mod items
    ModItems.init();

    GameRegistry.registerWorldGenerator(new OreGenerator());
}
项目:Amitcraft    文件:Amitcraft.java   
@PreInit
public void preInit(FMLPreInitializationEvent ev) {
    AmitLogger.info("PreInit");
    File file = ev.getSuggestedConfigurationFile();
    Amitcraft.config = new AmitConfig(file);
    AmitLogger.info("%s file %s", file.exists() ? "Loaded" : "Created", file.getName());

    Amitcraft.config.load();
    for (IDelegate d : this.delegates)
        d.getIds(Amitcraft.config);
    Amitcraft.config.save();

    GameRegistry.registerPlayerTracker(new UpdateNotifier());
    NetworkRegistry.instance().registerGuiHandler(Amitcraft.instance, new GuiHandler());
    MinecraftForge.EVENT_BUS.register(new SoundHandler());
}
项目:secri    文件:Maeme.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    boolean checkForDatabaseUpdates = config.get("general", "Check for database updates", true).getBoolean(true);
    modDirectory = new File(event.getModConfigurationDirectory().getParent());
    if (!DBHelper.has(checkForDatabaseUpdates)) {
        throw new RuntimeException("Can not start Pixelmon without SQLite jar or database!!! Please reinstall!!");
    }
    if (Loader.isModLoaded("Pokemobs"))
        System.exit(1);

    event.getModMetadata().version = "2.2";

    MaemeConfig.loadConfig(config);
}
项目:ShoulderSurfing    文件:ShoulderSurfing.java   
@PreInit
  public void preInit(FMLPreInitializationEvent event) {
    //load the last good configuration
    config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
    readConfig();
  }
项目:UrbanCraft-CommandForwarder    文件:CommandForwarder.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    logger = Logger.getLogger(ID);
    logger.setParent(FMLLog.getLogger());

    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    // post_url = config.get(config.CATEGORY_GENERAL, "post_url",
    // "http://localhost/post/",
    // "This is the url of which the mod posts updates to.").value;
    identifier = config.get(config.CATEGORY_GENERAL, "identifier", "commandforwarder", "This string determines the value of the id field in the post request.").value;
    debug = config.get(Configuration.CATEGORY_GENERAL, "debug", false, "Enable debuging?").getBoolean(true);

    ConfigCategory cmdcat = config.getCategory("commands");
    cmdcat.setComment("This is a list of command=url.");
    Map<String, Property> cmdmap = cmdcat.getValues();

    if (cmdmap.isEmpty()) {
        config.get("commands", "example", "http://localhost/post/");
    }
    for (Map.Entry i : cmdmap.entrySet()) {
        String k = (String) i.getKey();
        Property v = (Property) i.getValue();
        Command cmd = new Command(k, v.value);
        this.commands.add(cmd);
    }
    // public Map<String,Property> getValues()

    config.save();

    logger.info("debug: " + debug);
    logger.info("identifier: " + identifier);
    // logger.info("post_url: " + post_url);
}
项目:MMOMats    文件:MMOMats.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    LogHelper.init();
    LocalizationHandler.loadLanguages();
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
            .getAbsolutePath()
            + File.separator
            + Reference.CHANNEL_NAME
            + File.separator + Reference.MOD_ID + ".cfg"));
    ModBlocks.init();
    ModItems.init();
}
项目:Stereoscopic3D-for-Minecraft    文件:Stereoscopic3D.java   
@PreInit
public void preInit(FMLPreInitializationEvent event)
{
    LOG = event.getModLog();

    if (FMLCommonHandler.instance().getSide().isServer() && ObfuscationReflectionHelper.obfuscation)
        throw new RuntimeException("Stereoscopic3D should not be installed on a server!");

    initConfig(event);
    initRenderer();
}
项目:SimplePowerStorage    文件:SimplePowerStorage.java   
@PreInit
public void preInit(FMLPreInitializationEvent evt) {
    SPSConfig.setConfigFolderBase(evt.getModConfigurationDirectory());

    SPSConfig.loadCommonConfig(evt);

    SPSConfig.extractLang(new String[] { "en_US" });
    SPSConfig.loadLang();

    logger = evt.getModLog();
}
项目:deep-storage-tanks    文件:DeepStorageTanks.java   
@PreInit    // used in 1.5.2
public void preInit(FMLPreInitializationEvent event) {
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    deepStorageTankBlockID = config.getBlock("DeepStorageTank", deepStorageTankBlockID).getInt();
    config.save();
}
项目:NetCraft    文件:NetCraft.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {

    // Initialize the log helper
    // LogHelper.init();

    // Load the localization files into the LanguageRegistry
    LocalizationHandler.loadLanguages();

    // Initialize the configuration
    ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
            .getAbsolutePath()
            + File.separator
            + Reference.CHANNEL_NAME
            + File.separator + Reference.MOD_ID + ".cfg"));

    // Conduct the version check and log the result
    // VersionHelper.execute();

    // Initialize the Version Check Tick Handler (Client only)
    // TickRegistry.registerTickHandler(new VersionCheckTickHandler(),
    // Side.CLIENT);

    // Initialize the Render Tick Handler (Client only)
    // proxy.registerRenderTickHandler();

    // Register the KeyBinding Handler (Client only)
    // proxy.registerKeyBindingHandler();

    // Register the Sound Handler (Client only)
    // proxy.registerSoundHandler();

    // Initialize mod blocks
    // ModBlocks.init();

    // Initialize mod items
    ModItems.init();
}
项目:Andrew2448PowersuitAddons    文件:ModularPowersuitsAddons.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    AddonConfig.setConfigFolderBase(event.getModConfigurationDirectory());
    AddonConfig.initItems();
    proxy.registerRenderers();
    //proxy.readManuals();
}
项目:Reliquary    文件:Reliquary.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    // Initialize the log helper
    LogHelper.init();
    LocalizationHandler.loadLanguagesIntoRegistry();
    Config.init(event.getSuggestedConfigurationFile());
    proxy.registerSoundHandler();
    proxy.registerTickHandlers();
    XRItems.init();
    XRAlkahestry.init();
    AlkahestMap.init();
    XRItems.registerLiquidContainer();
    XRBlocks.init();
}
项目:HexxitGear    文件:HexxitGear.java   
@PreInit
public void preInit(FMLPreInitializationEvent evt) {
    HexxitGearConfig.setConfigFolderBase(evt.getModConfigurationDirectory());

    HexxitGearConfig.loadCommonConfig(evt);

    HexxitGearConfig.extractLang(new String[]{"en_US"});
    HexxitGearConfig.loadLang();
    HexxitGearConfig.registerDimBlacklist();

    logger = evt.getModLog();
    playerEventHandler = new PlayerEventHandler();
    MinecraftForge.EVENT_BUS.register(playerEventHandler);
}
项目:Bubblegum-Mod    文件:BubblegumMod.java   
@PreInit
public void preinit(FMLPreInitializationEvent event) {
    ConfigurationHandler.preConfig(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg"));
    AddedBlocks.preinit();
    AddedItems.preInit();
    AddedBlocks.blockRecipes();
    AddedItems.itemRecipes();
    AddedBiomes.initBiomes();
    AddedDimensions.InitDim();
    LocalizationHandler.loadlanguages();
    GameRegistry.registerCraftingHandler(new ColouringCraftingHandler());


}
项目:PowerConverters-RPModule    文件:RPModule.java   
@PreInit
public void preInit(FMLPreInitializationEvent e)
{
    powerSystemRedPower = new PowerSystem("RedPower", "RP2", 7000, 7000, null, null, "W");

    PowerSystem.registerPowerSystem(powerSystemRedPower);

    Configuration config = new Configuration(e.getSuggestedConfigurationFile());
    loadConfig(config);
}
项目:Kitchenmod    文件:KitchenMod.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {



 //Classes
 RecipeRemover.remover();
 ConfigurationHander.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + References.CHANNEL_NAME + File.separator + References.MOD_ID + ".cfg"));
 Blocks.blocksInit();
 Items.itemsInit();
 Crafting.craft();
}
项目:PlaceholderBlocks    文件:PlaceholderBlocks.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());

    FMLLog.log(Level.FINE, "PlaceholderBlocks loading config");

    try {
        cfg.load();

        ConfigCategory category = cfg.getCategory("Blocks");

        for (Map.Entry<String, Property> entry : category.entrySet()) {
            String key = entry.getKey();
            Property property = entry.getValue();

            if (property.getString().length() == 0) {
                // not set
                continue;
            }

            // parse configuration entry
            AbstractBlock abstractBlock = new AbstractBlock(key, property.getString());

            // add to list keyed by block ID
            List<AbstractBlock> list;
            if (abstractBlocks.containsKey(abstractBlock.id)) {
                list = abstractBlocks.get(abstractBlock.id);
            } else {
                list = new ArrayList<AbstractBlock>();
            }
            list.add(abstractBlock);

            abstractBlocks.put(abstractBlock.id, list);
        }
    } catch (Exception e) {
        FMLLog.log(Level.SEVERE, e, "PlaceholderBlocks had a problem loading it's configuration");
    } finally {
        cfg.save();
    }
}
项目:ModHearthstone    文件:ModHearthstone.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    ModHearthstone.config = new Configuration(event.getSuggestedConfigurationFile());
    ModHearthstone.config.load();

    proxy.registerSoundHandler();

    this.initPotionTypes();
}
项目:Minecraft-TomP2P    文件:TomP2P.java   
/**
 * {@inheritDoc}
 */
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    config = Config.load(event);
    side = event.getSide();
    P2P.register(new Server());
    if (side == Side.CLIENT) {
        P2P.register(new Client());
    }
}
项目:Decorative-Gems-Mod    文件:DecorativeGems.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    // Initialize the Blocks and Items
    BlockHelper.init();
    ItemHelper.init();
    // Initialize the Recipes and Dungeon loot
    RecipeHelper.init();
    // Register Ore spawns
    GameRegistry.registerWorldGenerator(new DecorativeGemsWorldGen());
}
项目:OldMods    文件:OldBooks.java   
@PreInit
public void preInit( FMLPreInitializationEvent event )
{
}
项目:forge_world_downloader    文件:Modloader.java   
@PreInit    // used in 1.5.2
public void preInit(FMLPreInitializationEvent event) {
        // Stub Method
}
项目:ForestryLegacy    文件:Forestry.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    core.preInit(event.getSourceFile(), this);
}
项目:MineTech    文件:MineTechPlus.java   
@PreInit
public void preInit(FMLPreInitializationEvent e){
    config = new ConfigHandler(e.getSuggestedConfigurationFile());
    TickRegistry.registerTickHandler(new TickHandler(), Side.CLIENT);
}
项目:EnhancedBooks    文件:BooksCore.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    Utils.loadConfig(event);
}
项目:HeroezMod    文件:Heroez.java   
@PreInit
   public void preInit(FMLPreInitializationEvent event) {
// Stub Method
   }
项目:Minecraft_on_Fire    文件:MOF.java   
@PreInit
public void preInit(FMLPreInitializationEvent event)
{
    config = new ConfigHandler(event.getSuggestedConfigurationFile());
    TickRegistry.registerTickHandler(new TickHandler(), Side.CLIENT);
}
项目:Badger-Mod    文件:BadgerMod.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) 
{

}
项目:ServerKey    文件:ServerKey.java   
@PreInit
   public void preInit(FMLPreInitializationEvent evt) 
{
    Config.init(evt);
    GameRegistry.registerPlayerTracker(new PlayerTracker());
   }
项目:PilesOfBlocks    文件:PilesOfBlocks.java   
@PreInit
public void preInit(FMLPreInitializationEvent event) {
    logger = event.getModLog();
    config = new Configuration(event.getSuggestedConfigurationFile());
}
项目:OreDupeFix    文件:OreDupeFix.java   
@PreInit
public static void preInit(FMLPreInitializationEvent event) {
    oreName2PreferredMod = new HashMap<String, String>();

    Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());

    FMLLog.log(Level.FINE, "OreDupeFix loading config");

    try {
        cfg.load();

        if (cfg.getCategoryNames().size() == 0) {
            loadDefaults(cfg);
        }

        ConfigCategory category = cfg.getCategory("PreferredOres");

        for (Map.Entry<String, Property> entry : category.entrySet()) {
            String name = entry.getKey();
            Property property = entry.getValue();

            if (property.getString().length() == 0) {
                // not set
                continue;
            }

            oreName2PreferredMod.put(name, property.getString());
        }

        shouldDumpOreDict = cfg.get(Configuration.CATEGORY_GENERAL, "dumpOreDict", true).getBoolean(true);
        verbose = cfg.get(Configuration.CATEGORY_GENERAL, "verbose", true).getBoolean(true);

        // TODO: refactor
        replaceCrafting = cfg.get(Configuration.CATEGORY_GENERAL, "replaceCrafting", true).getBoolean(true);
        replaceFurnace = cfg.get(Configuration.CATEGORY_GENERAL, "replaceFurnace", true).getBoolean(true);
        replaceFurnaceInsensitive = cfg.get(Configuration.CATEGORY_GENERAL, "replaceFurnaceInsensitive", true).getBoolean(true);
        replaceDungeonLoot = cfg.get(Configuration.CATEGORY_GENERAL, "replaceDungeonLoot", true).getBoolean(true);
        replaceIC2Compressor = cfg.get(Configuration.CATEGORY_GENERAL, "replaceIC2Compressor", true).getBoolean(true);
        replaceIC2Extractor = cfg.get(Configuration.CATEGORY_GENERAL, "replaceIC2Extractor", true).getBoolean(true);
        replaceIC2Macerator = cfg.get(Configuration.CATEGORY_GENERAL, "replaceIC2Macerator", true).getBoolean(true);
        replaceIC2Scrapbox = cfg.get(Configuration.CATEGORY_GENERAL, "replaceIC2Scrapbox", true).getBoolean(true);
    } catch (Exception e) {
        FMLLog.log(Level.SEVERE, e, "OreDupeFix had a problem loading it's configuration");
    } finally {
        cfg.save();
    }
}