// Path: src/main/java/de/maxgb/minecraft/second_screen/SecondScreenMod.java
// @Mod(modid = Constants.MOD_ID, name = Constants.NAME, version = Constants.VERSION, dependencies = "required-after:FML", guiFactory = Constants.GUI_FACTORY_CLASS, acceptableRemoteVersions="*")
// public class SecondScreenMod {
// 
// 	public WebSocketListener webSocketListener;
// 	public int port;
// 	public String hostname;
// 	public String latestOnlinePlayer="None since last restart";
// 	
// 	@Mod.Instance(Constants.MOD_ID)
// 	public static SecondScreenMod instance;
// 
// 	private final String TAG = "Main";
// 
// 	@EventHandler
// 	public void init(FMLInitializationEvent event) {
// 		MSSEventHandler handler = new MSSEventHandler();
// 		FMLCommonHandler.instance().bus().register(new Configs());
// 		FMLCommonHandler.instance().bus().register(handler);
// 		MinecraftForge.EVENT_BUS.register(handler);
// 	}
// 
// 	@EventHandler
// 	public void postInit(FMLPostInitializationEvent event) {
// 
// 	}
// 
// 	@EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 
// 		Configs.init(event.getSuggestedConfigurationFile());
// 
// 		//Sends message to VersionChecker if installed
// 		FMLInterModComms.sendRuntimeMessage(Constants.MOD_ID, "VersionChecker", "addVersionCheck",
// 				Constants.UPDATE_FILE_LINK);
// 
// 	}
// 
// 	@EventHandler
// 	public void serverStarting(FMLServerStartingEvent e) {
// 
// 		hostname = Configs.hostname;
// 		port = Configs.port;
// 
// 
// 		loadData();
// 
// 		//Register actions
// 		ActionManager.registerStandardActions();
// 
// 		//Register Commands
// 		MssCommand mssc = new MssCommand();
// 		mssc.addSubCommand(new RegisterRedstoneInfoCommand());
// 		mssc.addSubCommand(new RegisterUserCommand());
// 		mssc.addSubCommand(new RegisterObserverCommand());
// 		e.registerServerCommand(mssc);
// 		e.registerServerCommand(new GetIPCommand());
// 		e.registerServerCommand(new GetMSSPortCommand());
// 		e.registerServerCommand(new TestCommand());
// 		e.registerServerCommand(new ListInterfacesCommand());
// 
// 		start();
// 	}
// 
// 	@EventHandler
// 	public void serverStopping(FMLServerStoppingEvent e) {
// 		stop();
// 		saveData();
// 		ActionManager.removeAllActions();
// 	}
// 
// 	/**
// 	 * Creates and starts the websocket 
// 	 */
// 	private void start() {
// 		Logger.i(TAG, "Starting SecondScreenMod");
// 
// 		webSocketListener = new WebSocketListener();
// 		webSocketListener.start();
// 	}
// 
// 	/**
// 	 * Stops the websocket
// 	 */
// 	private void stop() {
// 		Logger.i(TAG, "Stopping SecondScreenMod");
// 		webSocketListener.stop();
// 
// 		webSocketListener = null;
// 	}
// 	
// 	/**
// 	 * Loads saved informations from files
// 	 */
// 	private void loadData(){
// 		//Loads observation files
// 		ObservingManager.loadObservingFile();
// 
// 		//Load users
// 		UserManager.loadUsers();
// 	}
// 	
// 	/**
// 	 * Saves all informations to files
// 	 */
// 	public void saveData(){
// 		ObservingManager.saveObservingFile();
// 		UserManager.saveUsers();
// 	}
// 	
// 	
// 
// }


import de.maxgb.minecraft.second_screen.SecondScreenMod;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
	public int compareTo(ICommand arg0) {

		return 0;
	}


	@Override
    public String getUsage(ICommandSender var1) {
        return "/getIP";
	}

	@Override
	public boolean isUsernameIndex(String[] var1, int var2) {
		return false;
	}

	@Override
    public String getName() {
        return "getIP";
	}

	@Override
    public List getAliases() {
        return aliases;
	}


	@Override
    public void execute(MinecraftServer server, ICommandSender sender, String[] args)
            throws CommandException {
// Path: src/main/java/de/maxgb/minecraft/second_screen/SecondScreenMod.java
// @Mod(modid = Constants.MOD_ID, name = Constants.NAME, version = Constants.VERSION, dependencies = "required-after:FML", guiFactory = Constants.GUI_FACTORY_CLASS, acceptableRemoteVersions="*")
// public class SecondScreenMod {
// 
// 	public WebSocketListener webSocketListener;
// 	public int port;
// 	public String hostname;
// 	public String latestOnlinePlayer="None since last restart";
// 	
// 	@Mod.Instance(Constants.MOD_ID)
// 	public static SecondScreenMod instance;
// 
// 	private final String TAG = "Main";
// 
// 	@EventHandler
// 	public void init(FMLInitializationEvent event) {
// 		MSSEventHandler handler = new MSSEventHandler();
// 		FMLCommonHandler.instance().bus().register(new Configs());
// 		FMLCommonHandler.instance().bus().register(handler);
// 		MinecraftForge.EVENT_BUS.register(handler);
// 	}
// 
// 	@EventHandler
// 	public void postInit(FMLPostInitializationEvent event) {
// 
// 	}
// 
// 	@EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 
// 		Configs.init(event.getSuggestedConfigurationFile());
// 
// 		//Sends message to VersionChecker if installed
// 		FMLInterModComms.sendRuntimeMessage(Constants.MOD_ID, "VersionChecker", "addVersionCheck",
// 				Constants.UPDATE_FILE_LINK);
// 
// 	}
// 
// 	@EventHandler
// 	public void serverStarting(FMLServerStartingEvent e) {
// 
// 		hostname = Configs.hostname;
// 		port = Configs.port;
// 
// 
// 		loadData();
// 
// 		//Register actions
// 		ActionManager.registerStandardActions();
// 
// 		//Register Commands
// 		MssCommand mssc = new MssCommand();
// 		mssc.addSubCommand(new RegisterRedstoneInfoCommand());
// 		mssc.addSubCommand(new RegisterUserCommand());
// 		mssc.addSubCommand(new RegisterObserverCommand());
// 		e.registerServerCommand(mssc);
// 		e.registerServerCommand(new GetIPCommand());
// 		e.registerServerCommand(new GetMSSPortCommand());
// 		e.registerServerCommand(new TestCommand());
// 		e.registerServerCommand(new ListInterfacesCommand());
// 
// 		start();
// 	}
// 
// 	@EventHandler
// 	public void serverStopping(FMLServerStoppingEvent e) {
// 		stop();
// 		saveData();
// 		ActionManager.removeAllActions();
// 	}
// 
// 	/**
// 	 * Creates and starts the websocket 
// 	 */
// 	private void start() {
// 		Logger.i(TAG, "Starting SecondScreenMod");
// 
// 		webSocketListener = new WebSocketListener();
// 		webSocketListener.start();
// 	}
// 
// 	/**
// 	 * Stops the websocket
// 	 */
// 	private void stop() {
// 		Logger.i(TAG, "Stopping SecondScreenMod");
// 		webSocketListener.stop();
// 
// 		webSocketListener = null;
// 	}
// 	
// 	/**
// 	 * Loads saved informations from files
// 	 */
// 	private void loadData(){
// 		//Loads observation files
// 		ObservingManager.loadObservingFile();
// 
// 		//Load users
// 		UserManager.loadUsers();
// 	}
// 	
// 	/**
// 	 * Saves all informations to files
// 	 */
// 	public void saveData(){
// 		ObservingManager.saveObservingFile();
// 		UserManager.saveUsers();
// 	}
// 	
// 	
// 
// }


// Path: src/main/java/de/maxgb/minecraft/second_screen/commands/GetIPCommand.java
import de.maxgb.minecraft.second_screen.SecondScreenMod;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

	public int compareTo(ICommand arg0) {

		return 0;
	}


	@Override
    public String getUsage(ICommandSender var1) {
        return "/getIP";
	}

	@Override
	public boolean isUsernameIndex(String[] var1, int var2) {
		return false;
	}

	@Override
    public String getName() {
        return "getIP";
	}

	@Override
    public List getAliases() {
        return aliases;
	}


	@Override
    public void execute(MinecraftServer server, ICommandSender sender, String[] args)
            throws CommandException {
		if (SecondScreenMod.instance.webSocketListener.isRunning()) {