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

Forge is confused ...

I have a Class with ITickHandler and Register that in my load:

public void load(FMLInitializationEvent event) throws Exception {				
       proxy.registerRenderers();
       TickRegistry.registerTickHandler(new TickHandler(), Side.SERVER);
}

 

public class TickHandler implements ITickHandler
{
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
	Base.logger.info("tick");
}
}

 

But nothing happen ...

I did program for 2 years with bukkit ... and this was easier ... must I say ... :(

Hi

 

You need to add this method to your TickHandler to tell it that you want SERVER ticks

 

  public EnumSet<TickType> ticks()

  {

    return EnumSet.of(TickType.SERVER);

  }

 

It's probably a good idea to add a check of the type to your tickStart as well, in case you want to add other ticks later', eg

 

tickStart:

    if (!type.contains(TickType.SERVER)) return;

 

-TGG

  • Author

Hi

 

You need to add this method to your TickHandler to tell it that you want SERVER ticks

 

  public EnumSet<TickType> ticks()

  {

    return EnumSet.of(TickType.SERVER);

  }

 

It's probably a good idea to add a check of the type to your tickStart as well, in case you want to add other ticks later', eg

 

tickStart:

    if (!type.contains(TickType.SERVER)) return;

 

-TGG

Thx! But one question .. how can you know that? I did search in the internet and here in the forum ~ 30 min ....

Hi

 

Yeah it's always easy once you know the answer! :-)  I pulled that from some of my own code, not sure where I got it from originally.  Forge is a bit like that sometimes.  Half the problem is finding the stuff that you don't even know should be there.

 

-TGG

 

 

The methods an interface defines are most of the time here for a reason.

It should have been pretty obvious by looking at TickType javadoc.

  • Author

Hi

 

Yeah it's always easy once you know the answer! :-)  I pulled that from some of my own code, not sure where I got it from originally.  Forge is a bit like that sometimes.  Half the problem is finding the stuff that you don't even know should be there.

 

-TGG

 

IMO is forge a bit confused ... I did need help for changing the weather ... in Bukkit was this rly easy, but here its sometimes ... sure that compatibility to server-client and mods with another mods are fine. But to code with the forge API ... that is sometimes a bit stressful

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.