Advertisement
Corosus

forge 4 server tick handler

Sep 2nd, 2012
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. package net.weather;
  2.  
  3. import java.util.EnumSet;
  4.  
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.src.GuiScreen;
  7.  
  8. import cpw.mods.fml.common.ITickHandler;
  9. import cpw.mods.fml.common.Side;
  10. import cpw.mods.fml.common.TickType;
  11.  
  12. public class ServerTickHandler implements ITickHandler
  13. {
  14.     @Override
  15.     public void tickStart(EnumSet<TickType> type, Object... tickData) {
  16.        
  17.     }
  18.  
  19.     @Override
  20.     public void tickEnd(EnumSet<TickType> type, Object... tickData)
  21.     {
  22.         if (type.equals(EnumSet.of(TickType.SERVER)))
  23.         {
  24.             onTickInGame();
  25.         }
  26.     }
  27.  
  28.     @Override
  29.     public EnumSet<TickType> ticks()
  30.     {
  31.         return EnumSet.of(TickType.SERVER);
  32.     }
  33.  
  34.     @Override
  35.     public String getLabel() { return null; }
  36.    
  37.     WeatherManager sWMan = new WeatherManager();
  38.  
  39.     public void onTickInGame()
  40.     {
  41.         WeatherMod.weather(Side.SERVER);
  42.         sWMan.tick(Side.SERVER);
  43.         //System.out.println("onTickInGame");
  44.         //TODO: Your Code Here
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement