CommandSender¶
class
命令发送者的抽象,既可以是玩家也可以是控制台。通过 AsPlayer() 可判断并转型。
命名空间 Endstone.Loader
继承 object
派生类 Actor, ConsoleCommandSender
属性¶
IsPlayer : bool¶
{ get; }
Name : string¶
{ get; }
发送者的名称。
PermissionLevel : PermissionLevel¶
{ get; }
方法¶
PermissionAttachment AddAttachment(PluginBase plugin)¶
Adds a new empty permission attachment to this sender.
PermissionAttachment AddAttachment(PluginBase plugin, string name, bool value)¶
Adds a new permission attachment with a single permission by name and value. The attachment is owned by this sender and stays valid until removed (or this sender is destroyed).
Actor AsActor()¶
ConsoleCommandSender AsConsole()¶
Player AsPlayer()¶
PermissionAttachmentInfo[] GetEffectivePermissions()¶
bool HasPermission(Permission permission)¶
Checks whether this sender has the given permission object.
bool HasPermission(string permission)¶
检查发送者是否拥有指定权限。
bool IsPermissionSet(Permission permission)¶
Checks whether this sender contains an override for the given permission object.
bool IsPermissionSet(string permission)¶
Checks whether this sender contains an override for the given permission, by fully qualified name.
void RecalculatePermissions()¶
bool RemoveAttachment(PermissionAttachment attachment)¶
Removes the given permission attachment from this sender. Returns true when removed successfully, false when it is not part of this sender.
void SendErrorMessage(string message)¶
void SendErrorMessage(string format, params object[] args)¶
void SendMessage(string message)¶
向发送者发送消息。