You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
Java
43 lines
1.3 KiB
Java
package net.minecraft.command;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.server.MinecraftServer;
|
|
import net.minecraft.util.ChatComponentTranslation;
|
|
import net.minecraft.world.World;
|
|
|
|
public class CommandShowSeed extends CommandBase
|
|
{
|
|
private static final String __OBFID = "CL_00001053";
|
|
|
|
/**
|
|
* Returns true if the given command sender is allowed to use this command.
|
|
*/
|
|
public boolean canCommandSenderUseCommand(ICommandSender sender)
|
|
{
|
|
return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(sender);
|
|
}
|
|
|
|
public String getCommandName()
|
|
{
|
|
return "seed";
|
|
}
|
|
|
|
/**
|
|
* Return the required permission level for this command.
|
|
*/
|
|
public int getRequiredPermissionLevel()
|
|
{
|
|
return 2;
|
|
}
|
|
|
|
public String getCommandUsage(ICommandSender sender)
|
|
{
|
|
return "commands.seed.usage";
|
|
}
|
|
|
|
public void processCommand(ICommandSender sender, String[] args)
|
|
{
|
|
Object object = sender instanceof EntityPlayer ? ((EntityPlayer)sender).worldObj : MinecraftServer.getServer().worldServerForDimension(0);
|
|
sender.addChatMessage(new ChatComponentTranslation("commands.seed.success", new Object[] {Long.valueOf(((World)object).getSeed())}));
|
|
}
|
|
} |