Search in sources :

Example 1 with EventHandler

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

the class MalmoMod method init.

@EventHandler
public void init(FMLInitializationEvent event) {
    if (event.getSide().isClient()) {
        this.client = new MalmoModClient();
        this.client.init(event);
    }
    if (event.getSide().isServer()) {
        this.server = new MalmoModServer();
        this.server.init(event);
    }
}
Also used : MalmoModClient(com.microsoft.Malmo.Client.MalmoModClient) MalmoModServer(com.microsoft.Malmo.Server.MalmoModServer) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 2 with EventHandler

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

the class WRNormalMod method init.

@EventHandler
public void init(FMLPreInitializationEvent event) {
    EntityRegistry.registerModEntity(new ResourceLocation("wrnormal", "scale_test"), EntityScaleTest.class, "scale_test", 0, instance, 60, 3, true);
    proxy.registerRenders();
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 3 with EventHandler

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

the class BrewingRecipeRegistryTest method init.

@EventHandler
public void init(FMLInitializationEvent event) {
    if (!ENABLE)
        return;
    // The following adds a recipe that brews a piece of rotten flesh "into" a diamond sword resulting in a diamond hoe
    BrewingRecipeRegistry.addRecipe(new ItemStack(Items.DIAMOND_SWORD), new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.DIAMOND_HOE));
    ItemStack output0 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.DIAMOND_SWORD), new ItemStack(Items.ROTTEN_FLESH));
    if (output0.getItem() == Items.DIAMOND_HOE)
        System.out.println("Recipe succefully registered and working. Diamond Hoe obtained.");
    // Testing if OreDictionary support is working. Register a recipe that brews a gemDiamond into a gold sword resulting in a diamond sword
    BrewingRecipeRegistry.addRecipe(new ItemStack(Items.GOLDEN_SWORD), "gemDiamond", new ItemStack(Items.DIAMOND_SWORD));
    ItemStack output1 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.GOLDEN_SWORD), new ItemStack(Items.DIAMOND));
    if (output1.getItem() == Items.DIAMOND_SWORD)
        System.out.println("Recipe succefully registered and working. Diamond Sword obtained.");
    // In vanilla, brewing netherwart into a water bottle results in an awkward potion (with metadata 16). The following tests if that still happens
    ItemStack output2 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.POTIONITEM, 1, 0), new ItemStack(Items.NETHER_WART));
    if (output2 != null && output2.getItem() == Items.POTIONITEM && output2.getItemDamage() == 16)
        System.out.println("Vanilla behaviour still in place. Brewed Water Bottle with Nether Wart and got Awkward Potion");
}
Also used : ItemStack(net.minecraft.item.ItemStack) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 4 with EventHandler

use of net.minecraftforge.fml.common.Mod.EventHandler in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class ValkyrienWarfareControlMod method preInit.

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    config = new Configuration(new File(ValkyrienWarfareMod.getWorkingFolder() + "/config/valkyrienwarfarecontrol.cfg"));
    config.load();
    proxy.preInit(event);
    config.save();
    registerBlocks(event);
    registerItems(event);
    registerCapibilities(event);
    proxy.preInit(event);
}
Also used : Configuration(net.minecraftforge.common.config.Configuration) File(java.io.File) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 5 with EventHandler

use of net.minecraftforge.fml.common.Mod.EventHandler in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class ValkyrienWarfareControlMod method init.

@EventHandler
public void init(FMLInitializationEvent event) {
    registerTileEntities(event);
    registerRecipies(event);
    registerNetworks(event);
    NetworkRegistry.INSTANCE.registerGuiHandler(this, new ControlGUIHandler());
    proxy.init(event);
}
Also used : ControlGUIHandler(ValkyrienWarfareControl.GUI.ControlGUIHandler) 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