package net.minecraft.command.server;

import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldSettings;

public class CommandPublishLocalServer extends CommandBase
{
	private static final String __OBFID = "CL_00000799";

	public String getCommandName()
	{
		return "publish";
	}

	public String getCommandUsage(ICommandSender par1ICommandSender)
	{
		return "commands.publish.usage";
	}

	public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
	{
		String s = MinecraftServer.getServer().shareToLAN(WorldSettings.GameType.SURVIVAL, false);

		if (s != null)
		{
			notifyAdmins(par1ICommandSender, "commands.publish.started", new Object[] {s});
		}
		else
		{
			notifyAdmins(par1ICommandSender, "commands.publish.failed", new Object[0]);
		}
	}
}