Overview

Namespaces

  • aliuly
    • common
      • selectors
    • loader
  • xPaw

Classes

  • ArmorItems
  • BasicCli
  • BasicHelp
  • BasicPlugin
  • ChatSession
  • Cmd
  • CmdSelector
  • ExpandVars
  • FastTransfer
  • FileUtils
  • FreezeSession
  • GetMotd
  • GetMotdAsyncTask
  • InvisibleSession
  • InvUtils
  • ItemName
  • mc
  • mc2
  • MoneyAPI
  • MPMU
  • Npc
  • PermUtils
  • PluginAsyncTask
  • PluginCallbackTask
  • PMScript
  • QueryAsyncTask
  • Rcon
  • RconTask
  • Session
  • ShieldSession
  • ShoppingCart
  • SignUtils
  • SkinUtils
  • SpySession
  • SubCommandMap
  • TPUtils
  • Overview
  • Namespace
  • Class

Class MPMU

My PocketMine Utils class

Abstract
Namespace: aliuly\common
Located at aliuly/common/MPMU.php
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

$mode
mode

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

$player
  • Player to index

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

$plugin
$filename

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
  • plugin to call
$method
  • method to call
$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

Register a command

Deprecated

Moved to Cmd class

Parameters

$plugin
  • plugin that "owns" the command
$executor
  • object that will be called onCommand
$cmd
  • Command name
$yaml
  • Additional settings for this command.
public static
# rmCommand( Server|Plugin $srv, str $cmd )

Unregisters a command

Unregisters a command

Deprecated

Moved to Cmd class

Parameters

$srv
$obj - Access path to server instance
$cmd
  • Command name to remove
public static
# sendPopup( pocketmine\Player $player, str $msg )

Send a PopUp, but takes care of checking if there are some plugins that might cause issues.

Send a PopUp, but takes care of checking if there are some plugins that might cause issues.

Currently only supports SimpleAuth and BasicHUD.

Parameters

$player
$msg
public static str|null
# startsWith( str $txt, str $tok )

Check prefixes

Check prefixes

Parameters

$txt
  • input text
$tok
  • keyword to test

Returns

str|null
public static
# getPlayer( pocketmine\command\CommandSender $c, str $n )

Look-up player

Look-up player

Parameters

$c
$req
$n
Constants summary
string VERSION

Const

str VERSION plugin version string
# "1.92.0"
Properties summary
protected static str[] $items

$items Nice names for items

$items Nice names for items

# []
API documentation generated by ApiGen