DimDoors/StevenDimDoors/mod_pocketDimClient/ClientTickHandler.java

68 lines
1.7 KiB
Java
Raw Normal View History

package StevenDimDoors.mod_pocketDimClient;
import java.util.EnumSet;
2013-05-30 08:30:17 +02:00
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
{
2013-05-30 08:30:17 +02:00
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {}
@Override
public void tickEnd(EnumSet<TickType> 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<TickType> 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
}
}