CommandPublishLocalServer .java

net.minecraft.command.server.CommandPublishLocalServer (class, 44 lines): members: getCommandUsage, getCommandName, processCommand. strings: "publish".

net.minecraft.command.serverclass44 linesserverextends CommandBase1.1 KB

API Surface (3)

String getCommandName()
String getCommandUsage(ICommandSender sender)
void processCommand(ICommandSender sender, String[] args)

String literals (4)

"publish"
"commands.publish.usage"
"commands.publish.started"
"commands.publish.failed"

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

CommandPublishLocalServer.java44 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.command.server;
2
3
import net.minecraft.command.CommandBase;
4
import net.minecraft.command.CommandException;
5
import net.minecraft.command.ICommandSender;
6
import net.minecraft.server.MinecraftServer;
7
import net.minecraft.world.WorldSettings;
8
9
public class CommandPublishLocalServer extends CommandBase
10
{
11
    /**
12
     * Gets the name of the command
13
     */
14
    public String getCommandName()
15
    {
16
        return "publish";
17
    }
18
19
    /**
20
     * Gets the usage string for the command.
21
     */
22
    public String getCommandUsage(ICommandSender sender)
23
    {
24
        return "commands.publish.usage";
25
    }
26
27
    /**
28
     * Callback when the command is invoked
29
     */
30
    public void processCommand(ICommandSender sender, String[] args) throws CommandException
31
    {
32
        String s = MinecraftServer.getServer().shareToLAN(WorldSettings.GameType.SURVIVAL, false);
33
34
        if (s != null)
35
        {
36
            notifyOperators(sender, this, "commands.publish.started", new Object[] {s});
37
        }
38
        else
39
        {
40
            notifyOperators(sender, this, "commands.publish.failed", new Object[0]);
41
        }
42
    }
43
}
44

Deobfuscated MCP 1.8.9 source of CommandPublishLocalServer from Marcelektro/MavenMCP-1.8.9 (net/minecraft/command/server/CommandPublishLocalServer.java), stored verbatim.