001 /* 002 * The FML Forge Mod Loader suite. 003 * Copyright (C) 2012 cpw 004 * 005 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or any later version. 007 * 008 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 009 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 010 * 011 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 012 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 013 */ 014 015 package cpw.mods.fml.common; 016 017 import java.util.EnumSet; 018 019 020 /** 021 * 022 * Tick handler for mods to implement and register through the TickRegistry 023 * 024 * The data available to each tick is documented in the TickType 025 * 026 * @author cpw 027 * 028 */ 029 public interface ITickHandler 030 { 031 032 /** 033 * Called at the "start" phase of a tick 034 * 035 * Multiple ticks may fire simultaneously- you will only be called once with all the firing ticks 036 * 037 * @param type 038 * @param tickData 039 */ 040 public void tickStart(EnumSet<TickType> type, Object... tickData); 041 042 /** 043 * Called at the "end" phase of a tick 044 * 045 * Multiple ticks may fire simultaneously- you will only be called once with all the firing ticks 046 * 047 * @param type 048 * @param tickData 049 */ 050 public void tickEnd(EnumSet<TickType> type, Object... tickData); 051 052 /** 053 * Returns the list of ticks this tick handler is interested in receiving at the minute 054 */ 055 public EnumSet<TickType> ticks(); 056 057 /** 058 * A profiling label for this tick handler 059 */ 060 public String getLabel(); 061 }