ok i think i got something like that already :
public class ServerTickHandler implements ITickHandler {
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData)
{
if(type.equals(EnumSet.of(TickType.PLAYER)))
{
onTickInGame();
}
}
public EnumSet ticks()
{
return EnumSet.of(TickType.PLAYER);
}
public String getLabel()
{
return null;
}
private void onTickInGame()
{
//put here any code that needs to be done server side, like set WorldGeneration, and let entities spawn on the first server tick.
//also put all the code in a if(world != null && !world.isRemote) statement, makes it so that you don't get NPEs from that.
}
}