Jump to content

Recommended Posts

Posted

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 :S )

 

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

Posted

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?

Posted

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 :/

 

Posted

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?

Posted

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?

Posted

Uh-oh.. i can't register my TickHandler properly :S

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.