类 ConsoleCommandSender
java.lang.Object
cn.nukkit.command.ConsoleCommandSender
- 所有已实现的接口:
CommandSender
,Permissible
,ServerOperator
- 直接已知子类:
RemoteConsoleCommandSender
- 作者:
- MagicDroidX (Nukkit Project)
-
构造器概要
-
方法概要
修饰符和类型方法说明addAttachment
(Plugin plugin) addAttachment
(Plugin plugin, String name) addAttachment
(Plugin plugin, String name, Boolean value) getName()
返回命令发送者的名称。EntitySelector 返回命令发送者所在的服务器。boolean
hasPermission
(Permission permission) boolean
hasPermission
(String name) boolean
isOp()
返回这个对象是不是服务器管理员。boolean
isPermissionSet
(Permission permission) boolean
isPermissionSet
(String name) boolean
isPlayer()
void
void
removeAttachment
(PermissionAttachment attachment) void
sendMessage
(TextContainer message) 给命令发送者返回信息。void
sendMessage
(String message) 给命令发送者返回信息。void
setOp
(boolean value) 把这个对象设置成服务器管理员。从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 cn.nukkit.command.CommandSender
asEntity, asPlayer, getLocation, getPosition, isEntity
-
构造器详细资料
-
ConsoleCommandSender
public ConsoleCommandSender()
-
-
方法详细资料
-
isPermissionSet
- 指定者:
isPermissionSet
在接口中Permissible
-
isPermissionSet
- 指定者:
isPermissionSet
在接口中Permissible
-
hasPermission
- 指定者:
hasPermission
在接口中Permissible
-
hasPermission
- 指定者:
hasPermission
在接口中Permissible
-
addAttachment
- 指定者:
addAttachment
在接口中Permissible
-
addAttachment
- 指定者:
addAttachment
在接口中Permissible
-
addAttachment
- 指定者:
addAttachment
在接口中Permissible
-
removeAttachment
- 指定者:
removeAttachment
在接口中Permissible
-
recalculatePermissions
public void recalculatePermissions()- 指定者:
recalculatePermissions
在接口中Permissible
-
getEffectivePermissions
- 指定者:
getEffectivePermissions
在接口中Permissible
-
isPlayer
public boolean isPlayer()- 指定者:
isPlayer
在接口中CommandSender
-
getServer
从接口复制的说明:CommandSender
EntitySelector 返回命令发送者所在的服务器。
Returns the server of the command sender.- 指定者:
getServer
在接口中CommandSender
- 返回:
- 命令发送者所在的服务器。
the server of the command sender.
-
sendMessage
从接口复制的说明:CommandSender
给命令发送者返回信息。
Sends a message to the command sender.- 指定者:
sendMessage
在接口中CommandSender
- 参数:
message
- 要发送的信息。
Message to send.- 另请参阅:
-
sendMessage
从接口复制的说明:CommandSender
给命令发送者返回信息。
Sends a message to the command sender.- 指定者:
sendMessage
在接口中CommandSender
- 参数:
message
- 要发送的信息。
Message to send.
-
getName
从接口复制的说明:CommandSender
返回命令发送者的名称。
Returns the name of the command sender.如果命令发送者是一个玩家,将会返回他的玩家名字(name)不是显示名字(display name)。 如果命令发送者是控制台,将会返回
"CONSOLE"
。
If this command sender is a player, will return his/her player name(not display name). If it is a console, will return"CONSOLE"
.当你需要判断命令的执行者是不是控制台时,可以用这个:
When you need to determine if the sender is a console, use this:
if(sender instanceof ConsoleCommandSender) .....;
- 指定者:
getName
在接口中CommandSender
- 返回:
- 命令发送者的名称。
the name of the command sender. - 另请参阅:
-
isOp
public boolean isOp()从接口复制的说明:ServerOperator
返回这个对象是不是服务器管理员。
Returns if this object is an operator.- 指定者:
isOp
在接口中ServerOperator
- 返回:
- 这个对象是不是服务器管理员。
if this object is an operator.
-
setOp
public void setOp(boolean value) 从接口复制的说明:ServerOperator
把这个对象设置成服务器管理员。
Sets this object to be an operator or not to be.- 指定者:
setOp
在接口中ServerOperator
- 参数:
value
-true
为授予管理员,false
为取消管理员。
true
for giving this operator orfalse
for cancelling.
-