package StevenDimDoors.mod_pocketDimClient; import java.util.EnumSet; import StevenDimDoors.mod_pocketDim.Spells; import StevenDimDoors.mod_pocketDim.mod_pocketDim; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; public class ClientTickHandler implements ITickHandler { @Override public void tickStart(EnumSet type, Object... tickData) {} @Override public void tickEnd(EnumSet type, Object... tickData) { if (type.equals(EnumSet.of(TickType.RENDER))) { onRenderTick(); } else if (type.equals(EnumSet.of(TickType.CLIENT))) { GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen; if (guiscreen != null) { onTickInGUI(guiscreen); } else { onTickInGame(); } } } @Override public EnumSet ticks() { return EnumSet.of(TickType.RENDER, TickType.CLIENT); // In my testing only RENDER, CLIENT, & PLAYER did anything on the client side. // Read 'cpw.mods.fml.common.TickType.java' for a full list and description of available types } @Override public String getLabel() { return null; } public void onRenderTick() { //System.out.println("onRenderTick"); //TODO: Your Code Here } public void onTickInGUI(GuiScreen guiscreen) { //System.out.println("onTickInGUI"); //TODO: Your Code Here } public void onTickInGame() { //System.out.println("onTickInGame"); //TODO: Your Code Here } }