CommandShowSeed .java

net.minecraft.command.CommandShowSeed (class, 51 lines): members: canCommandSenderUseCommand, getRequiredPermissionLevel, getCommandUsage, getCommandName.

net.minecraft.commandclass51 linescommonextends CommandBase1.4 KB

API Surface (5)

boolean canCommandSenderUseCommand(ICommandSender sender)
String getCommandName()
int getRequiredPermissionLevel()
String getCommandUsage(ICommandSender sender)
void processCommand(ICommandSender sender, String[] args)

String literals (3)

"seed"
"commands.seed.usage"
"commands.seed.success"

Code Graph: Dependencies (6)

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

Full Source

CommandShowSeed.java51 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.command;
2
3
import net.minecraft.entity.player.EntityPlayer;
4
import net.minecraft.server.MinecraftServer;
5
import net.minecraft.util.ChatComponentTranslation;
6
import net.minecraft.world.World;
7
8
public class CommandShowSeed extends CommandBase
9
{
10
    /**
11
     * Returns true if the given command sender is allowed to use this command.
12
     */
13
    public boolean canCommandSenderUseCommand(ICommandSender sender)
14
    {
15
        return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(sender);
16
    }
17
18
    /**
19
     * Gets the name of the command
20
     */
21
    public String getCommandName()
22
    {
23
        return "seed";
24
    }
25
26
    /**
27
     * Return the required permission level for this command.
28
     */
29
    public int getRequiredPermissionLevel()
30
    {
31
        return 2;
32
    }
33
34
    /**
35
     * Gets the usage string for the command.
36
     */
37
    public String getCommandUsage(ICommandSender sender)
38
    {
39
        return "commands.seed.usage";
40
    }
41
42
    /**
43
     * Callback when the command is invoked
44
     */
45
    public void processCommand(ICommandSender sender, String[] args) throws CommandException
46
    {
47
        World world = (World)(sender instanceof EntityPlayer ? ((EntityPlayer)sender).worldObj : MinecraftServer.getServer().worldServerForDimension(0));
48
        sender.addChatMessage(new ChatComponentTranslation("commands.seed.success", new Object[] {Long.valueOf(world.getSeed())}));
49
    }
50
}
51

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