Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.weather;
- import java.util.EnumSet;
- import net.minecraft.client.Minecraft;
- import net.minecraft.src.ContainerPlayer;
- import net.minecraft.src.EntityPlayer;
- import net.minecraft.src.GuiScreen;
- import net.minecraft.src.InventoryPlayer;
- import net.minecraft.src.ItemStack;
- import net.minecraft.src.ServerCommandManager;
- import net.minecraft.src.Slot;
- import net.minecraft.src.World;
- import net.weather.storm.StormManager;
- import net.weather.waves.CommandWaveHeight;
- import cpw.mods.fml.client.FMLClientHandler;
- import cpw.mods.fml.common.FMLCommonHandler;
- import cpw.mods.fml.common.ITickHandler;
- import cpw.mods.fml.common.Side;
- import cpw.mods.fml.common.TickType;
- import cpw.mods.fml.common.registry.EntityRegistry;
- public class ServerTickHandler implements ITickHandler
- {
- public static WeatherManager sWMan = new WeatherManager();
- public static StormManager sSMan = new StormManager();
- @Override
- public void tickStart(EnumSet<TickType> type, Object... tickData)
- {
- }
- @Override
- public void tickEnd(EnumSet<TickType> type, Object... tickData)
- {
- if (type.equals(EnumSet.of(TickType.SERVER)))
- {
- onTickInGame();
- }
- }
- @Override
- public EnumSet<TickType> ticks()
- {
- return EnumSet.of(TickType.SERVER);
- }
- @Override
- public String getLabel()
- {
- return null;
- }
- public static boolean addCommands = true;
- public void onTickInGame()
- {
- if (FMLCommonHandler.instance() == null || FMLCommonHandler.instance().getMinecraftServerInstance() == null)
- {
- return;
- }
- World world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(0);
- if (addCommands && world != null) {
- ((ServerCommandManager)FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager()).registerCommand(new CommandWaveHeight());
- addCommands = false;
- } else if (world == null) addCommands = true;
- if (world != null)
- {
- WeatherMod.weather(Side.SERVER, world);
- sWMan.tick(Side.SERVER, world);
- sSMan.tick(Side.SERVER);
- }
- world = null;//FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(127);
- if (world != null)
- {
- WeatherMod.weather(Side.SERVER, world);
- sWMan.tick(Side.SERVER, world);
- sSMan.tick(Side.SERVER);
- }
- //System.out.println("onTickInGame");
- //TODO: Your Code Here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement