Posted February 14, 201411 yr Hello everyone, i'm trying to update my mod to 1.7.2. In 1.6.4, i had TickHandler's, ConnectionHandler's, and other types of handlers. In 1.7, i noticed they were removed, and replaced with events. I never used Forge events separately before, so i dont realy know how to use them. Do i need to create a class implementing a "IEventHandler" type class? Any help would be appreciated. Thanks for reading . ~Geforce Potato's have skin. I have skin. Therefore, i am a potato. Follow me on Twitter! http://www.twitter.com/I_Mod_Minecraft
February 14, 201411 yr http://lmgtfy.com/?q=minecraft+forge+events Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
February 14, 201411 yr Also, link. One key point that I haven't yet included in that tutorial is that you need to be aware of which event bus your events are on, so you can register your handlers appropriately. You will need a separate handler for each event bus. TickEvents are part of cpw.mods.fml.common.gameevents, and have multiple types from which to choose (ClientTickEvent, ServerTickEvent, etc.). FML Events are registered like this: FMLCommonHandler.instance().bus().register(new YourFMLEventHandler()); Most of the other events are in net.minecraftforge.event, as well as net.minecraftforge.client.event, and these are typically registered as follows: MinecraftForge.EVENT_BUS.register(new YourEventHandler()); Some are registered instead to the TERRAIN_BUS, and yet others to the ORE_GEN_BUS, but most use the EVENT_BUS. Again, it's best to have a separate handler for each type that you need, and even to split up your handler into separate ones depending on usage if you find you have a lot of events. There doesn't seem to be any limit on the number you can register, though if you are listening to the same event in multiple handlers you will need to be extra careful that you are not conflicting with yourself. http://i.imgur.com/NdrFdld.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.