Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ITickHandler dont work? ...


DeeKay
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.