Methods summary
public static
str|boolean
|
#
version( str $version = "" )
libcommon library version. If a version is provided it will check
the version using apiCheck.
libcommon library version. If a version is provided it will check
the version using apiCheck.
Parameters
- $version
- Version to check
Returns
str|boolean
|
public static
str|boolean
|
#
apiVersion( str $version = "" )
Used to check the PocketMine API version
Used to check the PocketMine API version
Parameters
- $version
- Version to check
Returns
str|boolean
|
public static
boolean
|
#
apiCheck( str $api, str $version )
Checks API compatibility from $api against $version. $version is a
string containing the version. It can contain the following operators:
Checks API compatibility from $api against $version. $version is a
string containing the version. It can contain the following operators:
=, <=, <> or !=, =, !|~, <, >
Parameters
- $api
- Installed API version
- $version
- API version to compare against
Returns
boolean
|
public static
str
|
#
gamemodeStr( integer $mode )
Returns a localized string for the gamemode
Returns a localized string for the gamemode
Parameters
Returns
str
|
public static
boolean
|
#
access( pocketmine\command\CommandSender $sender, str $permission, boolean $msg = true )
Check's player or sender's permissions and shows a message if appropriate
Check's player or sender's permissions and shows a message if appropriate
Parameters
- $sender
- $permission
- $msg
- If false, no message is shown
Returns
boolean
|
public static
boolean
|
#
inGame( pocketmine\command\CommandSender $sender, boolean $msg = true )
Check's if $sender is a player in game
Check's if $sender is a player in game
Parameters
- $sender
- $msg
- If false, no message is shown
Returns
boolean
|
public static
str
|
#
iName( pocketmine\Player|str $player )
Takes a player and creates a string suitable for indexing
Takes a player and creates a string suitable for indexing
Parameters
Returns
str
|
public static
str|null
|
#
getResourceContents( Plugin $plugin, str $filename )
Lile file_get_contents but for a Plugin resource
Lile file_get_contents but for a Plugin resource
Parameters
Returns
str|null
|
public static
mixed
|
#
callPlugin( Server $server, str|array $plug, str $method, mixed $args, $default = null )
Call a plugin's function.
Call a plugin's function.
If the $plug parameter is given a string, it will simply look for that
plugin. If an array is provided, it is assumed to be of the form:
[ "plugin", "version" ]
So then it will check that the plugin exists, and the version number
matches according to the rules from apiCheck.
Also, if plugin contains an api property, it will use that as
the class for method calling instead.
Parameters
- $server
- pocketmine server instance
- $plug
- $method
- $args
- $default - If the plugin does not exist or it is not enable, this value is returned
- $default
Returns
mixed
|
public static
|
#
addCommand( Plugin $plugin, CommandExecutor $executor, str $cmd, array $yaml )
Register a command
Deprecated
Moved to Cmd class
Parameters
- $plugin
- plugin that "owns" the command
- $executor
- object that will be called onCommand
- $cmd
- $yaml
- Additional settings for this command.
|
public static
|
#
rmCommand( Server|Plugin $srv, str $cmd )
Unregisters a command
Deprecated
Moved to Cmd class
Parameters
- $srv
- $obj - Access path to server instance
- $cmd
|
public static
str|null
|
#
startsWith( str $txt, str $tok )
Check prefixes
Parameters
Returns
str|null
|
public static
|
#
getPlayer( pocketmine\command\CommandSender $c, str $n )
Look-up player
Parameters
|