Java Code Examples for cpw.mods.fml.common.event.FMLPreInitializationEvent#getModMetadata()

The following examples show how to use cpw.mods.fml.common.event.FMLPreInitializationEvent#getModMetadata() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ForgeMain.java    From FastAsyncWorldedit with GNU General Public License v3.0 5 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
    this.logger = event.getModLog();
    File directory = new File(event.getModConfigurationDirectory() + File.separator + "FastAsyncWorldEdit");
    MinecraftForge.EVENT_BUS.register(this);
    FMLCommonHandler.instance().bus().register(this);
    this.IMP = new FaweForge(this, event.getModLog(), event.getModMetadata(), directory);
    try {
        Class.forName("org.spongepowered.api.Sponge");
        Settings.IMP.QUEUE.PARALLEL_THREADS = 1;
    } catch (Throwable ignore) {}
}
 
Example 2
Source File: NBTEdit.java    From NBTEdit with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event){
	ModMetadata modMeta = event.getModMetadata();
	modMeta.authorList = Arrays.asList(new String[] { "Davidee" });
	modMeta.autogenerated = false;
	modMeta.credits = "Thanks to Mojang, Forge, and all your support.";
	modMeta.description = "Allows you to edit NBT Tags in-game.\nPlease visit the URL above for help.";
	modMeta.url = "http://www.minecraftforum.net/topic/1558668-151/";
	
	
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
	opOnly = config.get("General", "opOnly", true, "true if only Ops can NBTEdit; false allows users in creative mode to NBTEdit").getBoolean(true);
	config.save();
}
 
Example 3
Source File: PneumaticCraft.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void PreInit(FMLPreInitializationEvent event){
    event.getModMetadata().version = Versions.fullVersionString();
    isNEIInstalled = Loader.isModLoaded(ModIds.NEI);

    PneumaticRegistry.init(PneumaticCraftAPIHandler.getInstance());
    UpgradeRenderHandlerList.init();
    SensorHandler.init();
    Config.init(event.getSuggestedConfigurationFile());
    ThirdPartyManager.instance().index();

    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    tabPneumaticCraft = new CreativeTabPneumaticCraft("tabPneumaticCraft");
    Fluids.initFluids();
    Blockss.init();
    Itemss.init();
    HackableHandler.addDefaultEntries();
    ModuleRegistrator.init();
    WidgetRegistrator.init();
    ThirdPartyManager.instance().preInit();
    TileEntityRegistrator.init();
    EntityRegistrator.init();
    SemiBlockInitializer.init();
    CraftingRegistrator.init();
    VillagerHandler.instance().init();
    GameRegistry.registerWorldGenerator(new WorldGeneratorPneumaticCraft(), 0);
    AchievementHandler.init();
    HeatBehaviourManager.getInstance().init();

    proxy.registerRenders();
    proxy.registerHandlers();
    tickHandler = new TickHandlerPneumaticCraft();
    FMLCommonHandler.instance().bus().register(tickHandler);
    MinecraftForge.EVENT_BUS.register(new EventHandlerPneumaticCraft());
    MinecraftForge.EVENT_BUS.register(new EventHandlerUniversalSensor());
    MinecraftForge.EVENT_BUS.register(new DroneSpecialVariableHandler());

    FMLCommonHandler.instance().bus().register(new CraftingHandler());
    FMLCommonHandler.instance().bus().register(new Config());
}
 
Example 4
Source File: Gadomancy.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
    event.getModMetadata().version = VERSION;
    ModConfig.init(event.getSuggestedConfigurationFile());
    proxy.preInitalize();
}