Skip to content

Class endstone::CommandSender

ClassList > endstone > CommandSender

Represents a command sender.

  • #include <endstone/command/command_sender.h>

Inherits the following classes: endstone::Permissible

Inherited by the following classes: endstone::Actor, endstone::BlockCommandSender, endstone::CommandSenderWrapper, endstone::ConsoleCommandSender

Public Functions

Type Name
virtual std::string getName () const = 0
Gets the name of this command sender.
virtual Server & getServer () const = 0
Returns the server instance that this command is running on.
virtual void sendErrorMessage (const Message & message) const = 0
Sends this sender a error message.
void sendErrorMessage (const fmt::format_string< Args... > format, Args &&... args) const
virtual void sendMessage (const Message & message) const = 0
Sends this sender a message.
void sendMessage (const fmt::format_string< Args... > format, Args &&... args) const

Public Functions inherited from endstone::Permissible

See endstone::Permissible

Type Name
virtual PermissionAttachment * addAttachment (Plugin & plugin, const std::string & name, bool value) = 0
Adds a new PermissionAttachment with a single permission by name and value.
virtual PermissionAttachment * addAttachment (Plugin & plugin) = 0
Adds a new empty PermissionAttachment to this object.
virtual std::unordered_set< PermissionAttachmentInfo * > getEffectivePermissions () const = 0
Gets a set containing all the permissions currently in effect by this object.
virtual PermissionLevel getPermissionLevel () const = 0
Gets the permission level of this object.
virtual bool hasPermission (std::string name) const = 0
Gets the value of the specified permission, if set. If a permission override is not set on this object, the default value of the permission will be returned.
virtual bool hasPermission (const Permission & perm) const = 0
Gets the value of the specified permission, if set. If a permission override is not set on this object, the default value of the permission will be returned.
virtual bool isPermissionSet (std::string name) const = 0
Checks if this object contains an override for the specified permission, by fully qualified name.
virtual bool isPermissionSet (const Permission & perm) const = 0
Checks if this object contains an override for the specified Permission .
virtual void recalculatePermissions () = 0
Recalculates the permissions for this object, if the attachments have changed values. This should very rarely need to be called from a plugin.
virtual bool removeAttachment (PermissionAttachment & attachment) = 0
Removes the given PermissionAttachment from this object.

Public Functions inherited from endstone::Object

See endstone::Object

Type Name
T * as ()
Attempts to cast this object to the given type T.
const T * as () const
Attempts to cast this object to the given type T.
virtual const std::type_info & getClassTypeId () const = 0
bool is () const
Checks if this object is an instance of the given type T (or a subclass of T).
virtual bool isInstanceOf (const std::type_info & target) const = 0
virtual ~Object () = default

Public Functions Documentation

function getName

Gets the name of this command sender.

virtual std::string endstone::CommandSender::getName () const = 0

Returns:

Name of the sender


function getServer

Returns the server instance that this command is running on.

virtual Server & endstone::CommandSender::getServer () const = 0

Returns:

Server instance


function sendErrorMessage [½]

Sends this sender a error message.

virtual void endstone::CommandSender::sendErrorMessage (
    const Message & message
) const = 0

Parameters:

  • message Error message to be displayed

function sendErrorMessage [2/2]

template<typename... Args>
inline void endstone::CommandSender::sendErrorMessage (
    const fmt::format_string< Args... > format,
    Args &&... args
) const

function sendMessage [½]

Sends this sender a message.

virtual void endstone::CommandSender::sendMessage (
    const Message & message
) const = 0

Parameters:

  • message Message to be displayed

function sendMessage [2/2]

template<typename... Args>
inline void endstone::CommandSender::sendMessage (
    const fmt::format_string< Args... > format,
    Args &&... args
) const


The documentation for this class was generated from the following file include/endstone/command/command_sender.h