Posted December 10, 201311 yr 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 ...
December 10, 201311 yr 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
December 10, 201311 yr 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 ....
December 10, 201311 yr 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
December 10, 201311 yr 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.
December 11, 201311 yr 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.