001/*
002 * Forge Mod Loader
003 * Copyright (c) 2012-2013 cpw.
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser Public License v2.1
006 * which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
008 * 
009 * Contributors:
010 *     cpw - implementation
011 */
012
013package cpw.mods.fml.common;
014
015import java.util.EnumSet;
016
017
018/**
019 * 
020 * Tick handler for mods to implement and register through the TickRegistry
021 * 
022 * The data available to each tick is documented in the TickType
023 * 
024 * @author cpw
025 *
026 */
027public interface ITickHandler
028{
029
030    /**
031     * Called at the "start" phase of a tick
032     * 
033     * Multiple ticks may fire simultaneously- you will only be called once with all the firing ticks
034     * 
035     * @param type
036     * @param tickData
037     */
038    public void tickStart(EnumSet<TickType> type, Object... tickData);
039    
040    /**
041     * Called at the "end" phase of a tick
042     * 
043     * Multiple ticks may fire simultaneously- you will only be called once with all the firing ticks
044     * 
045     * @param type
046     * @param tickData
047     */
048    public void tickEnd(EnumSet<TickType> type, Object... tickData);
049    
050    /**
051     * Returns the list of ticks this tick handler is interested in receiving at the minute
052     */
053    public EnumSet<TickType> ticks();
054    
055    /**
056     * A profiling label for this tick handler
057     */
058    public String getLabel();
059}