Posted January 31, 201312 yr Hello there, I've been trying to make a Scheduled Tick handler, but I'm not sure where to register it and how. This is how I do it nowin the base mod class: @ServerStarting public void serverStarting(FMLServerStartingEvent event) { TickHandler tickHandler = new TickHandler(chunkControl); TickRegistry.registerScheduledTickHandler(tickHandler, Side.SERVER); } Note that chunkControl is an object of the base mod class(and in every other thing works ok). And this is the Tick Handler: public class TickHandler implements IScheduledTickHandler { private ChunkControl chunkControl; public TickHandler (ChunkControl chunkcontrol){ chunkControl = chunkcontrol; } @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 chunkControl.updateReserve(); } @Override public EnumSet<TickType> ticks() { // TODO Auto-generated method stub return null; } @Override public String getLabel() { // TODO Auto-generated method stub return null; } @Override public int nextTickSpacing() { // TODO Auto-generated method stub return 1; } } When I debug it doesn't go through any of the handler methods. What am I doing wrong? Also and slightly unrelated, the return of the nextTickSpacing method is the amount of ticks until the tickStart is called? or is it of the tickEnd? or I'm missing absolutely everything? Thank you.
January 31, 201312 yr Author Okay I was able to pull it out after a while. The problem was that I had to return a EnumSet of some sort in the ticks() method, so I did this: @Override public EnumSet<TickType> ticks() { // TODO Auto-generated method stub return EnumSet.of(TickType.SERVER); }
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.