Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

  • 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?

  • 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 :P

  • 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? :)

 

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

 

  • 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?

  • 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?

  • 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?

  • 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!

  • Author

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.