    001package net.minecraft.command;
    002
    003import net.minecraft.server.MinecraftServer;
    004import net.minecraft.world.EnumGameType;
    005
    006public class CommandServerPublishLocal extends CommandBase
    007{
    008    public String getCommandName()
    009    {
    010        return "publish";
    011    }
    012
    013    /**
    014     * Return the required permission level for this command.
    015     */
    016    public int getRequiredPermissionLevel()
    017    {
    018        return 4;
    019    }
    020
    021    public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
    022    {
    023        String s = MinecraftServer.getServer().shareToLAN(EnumGameType.SURVIVAL, false);
    024
    025        if (s != null)
    026        {
    027            notifyAdmins(par1ICommandSender, "commands.publish.started", new Object[] {s});
    028        }
    029        else
    030        {
    031            notifyAdmins(par1ICommandSender, "commands.publish.failed", new Object[0]);
    032        }
    033    }
    034}