Search in sources :

Example 21 with EventHandler

use of net.minecraftforge.fml.common.Mod.EventHandler in project MinecraftForge by MinecraftForge.

the class ModelLoaderRegistryDebug method preInit.

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    List<Block> blocks = Lists.newArrayList();
    blocks.add(CustomModelBlock.instance);
    blocks.add(OBJTesseractBlock.instance);
    blocks.add(OBJVertexColoring1.instance);
    //blocks.add(OBJDirectionEye.instance);
    blocks.add(OBJVertexColoring2.instance);
    blocks.add(OBJDirectionBlock.instance);
    blocks.add(OBJCustomDataBlock.instance);
    //blocks.add(OBJDynamicEye.instance);
    for (Block block : blocks) {
        GameRegistry.register(block);
        GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
    }
    GameRegistry.registerTileEntity(OBJTesseractTileEntity.class, OBJTesseractBlock.name);
    GameRegistry.registerTileEntity(OBJVertexColoring2TileEntity.class, OBJVertexColoring2.name);
    //GameRegistry.registerTileEntity(OBJDynamicEyeTileEntity.class, OBJDynamicEye.name);
    if (event.getSide() == Side.CLIENT)
        clientPreInit();
}
Also used : Block(net.minecraft.block.Block) ItemBlock(net.minecraft.item.ItemBlock) ItemBlock(net.minecraft.item.ItemBlock) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 22 with EventHandler

use of net.minecraftforge.fml.common.Mod.EventHandler in project Bookshelf by Darkhax-Minecraft.

the class Bookshelf method onConstruction.

@EventHandler
public void onConstruction(FMLConstructionEvent event) {
    CraftingManager.getInstance().recipes = new ModTrackingList(CraftingManager.getInstance().recipes);
    AnnotationUtils.asmData = event.getASMHarvestedData();
    MinecraftForge.EVENT_BUS.register(new BookshelfEvents());
}
Also used : ModTrackingList(net.darkhax.bookshelf.lib.ModTrackingList) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 23 with EventHandler

use of net.minecraftforge.fml.common.Mod.EventHandler in project RecurrentComplex by Ivorforce.

the class RecurrentComplex method preInit.

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    logger = event.getModLog();
    config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    RCConfig.loadConfig(null);
    config.save();
    // After loading config, re-test vanilla acceptance, because of lightweight mode
    NetworkRegistry.INSTANCE.registry().get(Loader.instance().getIndexedModList().get(MOD_ID)).testVanillaAcceptance();
    logger.trace(isLite() ? "Entering lightweight mode!" : "Entering default mode!");
    loader = new FileLoader();
    saver = new FileSaver();
    remapper = new FMLRemapper();
    specialRegistry = new MCRegistrySpecial(mcRegistry = new MCRegistryRemapping(new MCRegistryDefault(), remapper), remapper);
    cremapper = new FMLRemapperConvenience(MOD_ID, specialRegistry, remapper);
    missingRemapper = new FMLMissingRemapper(new MCRegistryDefault(), remapper);
    forgeEventHandler = new RCForgeEventHandler();
    forgeEventHandler.register();
    terrainEventHandler = new RCTerrainGenEventHandler();
    terrainEventHandler.register();
    recurrentComplexEventHandler = new RCRecurrentComplexEventHandler();
    recurrentComplexEventHandler.register();
    guiHandler = new RCGuiHandler();
    IvGuiRegistry.INSTANCE.register(MOD_ID, guiHandler);
    communicationHandler = new RCCommunicationHandler(logger, MOD_ID, instance);
    RCRegistryHandler.preInit(event, this);
    proxy.preInit(event);
}
Also used : Configuration(net.minecraftforge.common.config.Configuration) RCGuiHandler(ivorius.reccomplex.gui.RCGuiHandler) MCRegistrySpecial(ivorius.reccomplex.world.gen.feature.structure.registry.MCRegistrySpecial) RCForgeEventHandler(ivorius.reccomplex.events.handlers.RCForgeEventHandler) FileSaver(ivorius.reccomplex.files.saving.FileSaver) MCRegistryDefault(ivorius.ivtoolkit.tools.MCRegistryDefault) RCRecurrentComplexEventHandler(ivorius.reccomplex.events.handlers.RCRecurrentComplexEventHandler) FileLoader(ivorius.reccomplex.files.loading.FileLoader) RCTerrainGenEventHandler(ivorius.reccomplex.events.handlers.RCTerrainGenEventHandler) RCTerrainGenEventHandler(ivorius.reccomplex.events.handlers.RCTerrainGenEventHandler) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler) RCForgeEventHandler(ivorius.reccomplex.events.handlers.RCForgeEventHandler) RCRecurrentComplexEventHandler(ivorius.reccomplex.events.handlers.RCRecurrentComplexEventHandler)

Example 24 with EventHandler

use of net.minecraftforge.fml.common.Mod.EventHandler in project Realistic-Terrain-Generation by Team-RTG.

the class RTG method initPre.

@EventHandler
public void initPre(FMLPreInitializationEvent event) {
    instance = this;
    worldtype = new WorldTypeRTG(ModInfo.WORLD_TYPE);
    DimensionManagerRTG.addRTGDimension(DimensionManagerRTG.OVERWORLD);
    RTGAPI.configPath = event.getModConfigurationDirectory() + File.separator + ModInfo.CONFIG_DIRECTORY + File.separator;
    RTGAPI.rtgConfig = new RTGConfig();
    RTGAPI.rtgConfig.load(configPath + "rtg.cfg");
    this.registerStructures();
}
Also used : WorldTypeRTG(rtg.world.WorldTypeRTG) RTGConfig(rtg.api.config.RTGConfig) WorldTypeMessageEventHandler(rtg.event.WorldTypeMessageEventHandler) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 25 with EventHandler

use of net.minecraftforge.fml.common.Mod.EventHandler in project Realistic-Terrain-Generation by Team-RTG.

the class RTG method init.

@EventHandler
public void init(FMLInitializationEvent event) {
    eventMgr = new EventManagerRTG();
    eventMgr.registerEventHandlers();
    // This event handler unregisters itself, so it doesn't need to be a part of the event management system.
    if (config().ENABLE_WORLD_TYPE_NOTIFICATION_SCREEN.get()) {
        MinecraftForge.EVENT_BUS.register(WorldTypeMessageEventHandler.instance);
    }
}
Also used : EventManagerRTG(rtg.event.EventManagerRTG) WorldTypeMessageEventHandler(rtg.event.WorldTypeMessageEventHandler) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Aggregations

EventHandler (net.minecraftforge.fml.common.Mod.EventHandler)33 ItemStack (net.minecraft.item.ItemStack)5 Configuration (net.minecraftforge.common.config.Configuration)5 File (java.io.File)3 ForgeEventHandler (net.geforcemods.securitycraft.handlers.ForgeEventHandler)3 BookshelfEvents (net.darkhax.bookshelf.BookshelfEvents)2 ChestBuilder (net.darkhax.bookshelf.builder.ChestBuilder)2 RegistryHelper (net.darkhax.bookshelf.registry.RegistryHelper)2 TeleportEventHandler (net.dyeo.teleporter.event.TeleportEventHandler)2 CommandModule (net.geforcemods.securitycraft.commands.CommandModule)2 CommandSC (net.geforcemods.securitycraft.commands.CommandSC)2 Block (net.minecraft.block.Block)2 ItemBlock (net.minecraft.item.ItemBlock)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 ModMetadata (net.minecraftforge.fml.common.ModMetadata)2 WorldTypeMessageEventHandler (rtg.event.WorldTypeMessageEventHandler)2 ControlGUIHandler (ValkyrienWarfareControl.GUI.ControlGUIHandler)1 ValkyrienWarfareWorldGen (ValkyrienWarfareWorld.WorldGen.ValkyrienWarfareWorldGen)1 GuiHandler (betterwithaddons.client.GuiHandler)1 ModConfiguration (betterwithaddons.config.ModConfiguration)1