Posted March 7, 201411 yr Hi there, please forgive me, this is my first time using forge for developing a little personal visualization for SP (i make these a god-awful lot ) What i would like help in is figuring out what i need to do differently in order to make my mod work with forge. I have a mod that at the moment just edits base Minecraft classes. (Minecraft.java, GuiIngame.java, RenderGlobal.java) though i assume that working through forge would no longer allow me to do this and get away with it, so how do i go about editing these classes so that they work when it comes to obfuscating, zipping and placing in the mods folder? thank you in advance, AussieTerra
March 7, 201411 yr Author That's what i'm after I'm extreeemely familiar with extending classes and whatnot to avoid editing base classes however i'm not entirely sure whether Forge and even minecraft structure allows for it. does Forge have a solution to overriding certain parts of a class without editing their base?
March 7, 201411 yr Author just rendering AABBs in the world when desired with a HUD element reflecting it's state EDIT: oh and also the good old key toggle
March 8, 201411 yr Author thank you very much for the quick replies, i'm looking at those methods/classes but not sure how to use them within my mod class, any extra pointers?
March 8, 201411 yr Hi Try these links http://greyminecraftcoder.blogspot.com.au/2013/12/forge-techniques-events.html and http://www.minecraftforum.net/topic/1419836-forge-4x-events-howto/ -TGG
March 8, 201411 yr Author Thanks mate but non of them tell me the proper event for a key being hit.. and i've been trawling tutorials and all of them tell me to do something different each time which is excruciating to understand
March 8, 201411 yr Author so i make a void that accepts a KeyEvent and Annotate it with @ForgeSubscribe in order to check the key and process any actions i want from there?
March 8, 201411 yr Author brilliant, thank you very much for being patient with me From my reading i assume i must make a TickHandler class and register it similar to the eventHandler class i've had to make?
March 8, 201411 yr Author rendering AABBs and calculating where to render them relative to the player from a list of co-ordinates i've just been reading tutorial after tutorial and they're saying stuff about TickHandlers and whatnot does forge have a magical way of doing that?
March 8, 201411 yr Author Sweet, thank you very much! i know 1.7.2 bring along RenderTickEvent.. what was it before 1.7.2 was released?
March 8, 201411 yr Author Thank you very much! you've been an amazing help and very patient with what i now see as my completely random and all-over-the-place questions.. i really appreciate it!
March 8, 201411 yr Author Uh-oh.. i can't register my TickHandler properly How do i set it up properly? i've included my code below in the main mod file: ... public VisualizationsClientProxy proxy; @EventHandler public void load(FMLInitializationEvent event) { proxy.registerClientTickHandler(); ... } in my proxy file: public void registerClientTickHandler() { TickRegistry.registerTickHandler(new VisualizationsRenderTickHandler(), Side.CLIENT); } The tick handle: import java.util.EnumSet; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class VisualizationsRenderTickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { // TODO Auto-generated method stub } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { // TODO Auto-generated method stub System.out.println("TickEnd"); } @Override public EnumSet<TickType> ticks() { // TODO Auto-generated method stub return null; } @Override public String getLabel() { // TODO Auto-generated method stub return null; } }
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.