DeeKay Posted December 10, 2013 Posted December 10, 2013 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 ... Quote
TheGreyGhost Posted December 10, 2013 Posted December 10, 2013 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 Quote
DeeKay Posted December 10, 2013 Author Posted December 10, 2013 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 .... Quote
TheGreyGhost Posted December 10, 2013 Posted December 10, 2013 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 Quote
GotoLink Posted December 10, 2013 Posted December 10, 2013 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. Quote
DeeKay Posted December 11, 2013 Author Posted December 11, 2013 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 Quote
Recommended Posts
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.