PocketMine-MP 5.19.1 git-5cc1068cd43264d3363295eb8d6901e02f467897
|
Static Public Member Functions | |
static | assumeNotFalse (mixed $value, \Closure|string $context="This should never be false") |
static | checkFloatNotInfOrNaN (string $name, float $float) |
static | checkLocationNotInfOrNaN (Location $location) |
static | checkUTF8 (string $string) |
static | checkVector3NotInfOrNaN (Vector3 $vector3) |
static | cloneCallback () |
static | cloneObjectArray (array $array) |
static | currentTrace (int $skipFrames=0) |
static | getCoreCount (bool $recalculate=false) |
static | getMachineUniqueId (string $extra="") |
static | getNiceClassName (object $obj) |
static | getNiceClosureName (\Closure $closure) |
static | getOpcacheJitMode () |
static | getOS (bool $recalculate=false) |
static | getReferenceCount (object $value, bool $includeCurrent=true) |
static | hexdump (string $bin) |
static | javaStringHash (string $string) |
static | parseDocComment (string $docComment) |
static | printable (mixed $str) |
static | printableCurrentTrace (int $skipFrames=0) |
static | printableExceptionInfo (\Throwable $e, $trace=null) |
static | printableTrace (array $trace, int $maxStringLength=80) |
static | printableTraceWithMetadata (array $rawTrace, int $maxStringLength=80) |
static | stringifyKeys (array $array) |
static | testValidInstance (string $className, string $baseName) |
static | validateArrayValueType (array $array, \Closure $validator) |
static | validateCallableSignature (callable|CallbackType $signature, callable $subject) |
Public Attributes | |
const | OS_ANDROID = "android" |
const | OS_BSD = "bsd" |
const | OS_IOS = "ios" |
const | OS_LINUX = "linux" |
const | OS_MACOS = "mac" |
const | OS_UNKNOWN = "other" |
const | OS_WINDOWS = "win" |
|
static |
@phpstan-template TValue @phpstan-param TValue|false $value @phpstan-param string|\Closure() : string $context @phpstan-return TValue
Definition at line 623 of file Utils.php.
Referenced by pocketmine\resourcepacks\ZippedResourcePack\__construct(), and pocketmine\command\defaults\TimingsCommand\execute().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
@phpstan-template TKey of array-key @phpstan-template TValue of object
object[] | $array | @phpstan-param array<TKey, TValue> $array |
Definition at line 185 of file Utils.php.
Referenced by pocketmine\crafting\ShapelessRecipe\__construct(), and pocketmine\crafting\ShapedRecipe\__construct().
|
static |
|
static |
|
static |
Gets this machine / server instance unique ID Returns a hash, the first 32 characters (or 16 if raw) will be an identifier that won't change frequently. The rest of the hash will change depending on other factors.
string | $extra | optional, additional data to identify the machine |
Definition at line 199 of file Utils.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
|
static |
|
static |
|
static |
Returns an integer describing the current OPcache JIT setting.
Definition at line 657 of file Utils.php.
Referenced by pocketmine\command\defaults\VersionCommand\execute().
|
static |
Returns the current Operating System Windows => win MacOS => mac iOS => ios Android => android Linux => Linux BSD => bsd Other => other
Definition at line 275 of file Utils.php.
Referenced by pocketmine\stats\SendUsageTask\__construct(), pocketmine\command\defaults\VersionCommand\execute(), and pocketmine\utils\Process\getAdvancedMemoryUsage().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Similar to Utils::printableTrace()
, but associates metadata such as file and line number with each frame. This is used to transmit thread-safe information about crash traces to the main thread when a thread crashes.
mixed[][] | $rawTrace | @phpstan-param list<array<string, mixed>> $rawTrace |
|
static |
Generator which forces array keys to string during iteration. This is necessary because PHP has an anti-feature where it casts numeric string keys to integers, leading to various crashes.
@phpstan-template TKeyType of string @phpstan-template TValueType @phpstan-param array<TKeyType, TValueType> $array @phpstan-return \Generator<TKeyType, TValueType, void, void>
Definition at line 605 of file Utils.php.
Referenced by pocketmine\data\bedrock\item\upgrade\R12ItemIdToBlockIdMap\__construct(), pocketmine\data\bedrock\ItemTagToIdMap\__construct(), and pocketmine\network\mcpe\convert\BlockStateDictionary\__construct().
|
static |
@phpstan-param class-string $className @phpstan-param class-string $baseName
Definition at line 539 of file Utils.php.
Referenced by pocketmine\block\BlockIdentifier\__construct(), pocketmine\entity\EntityFactory\register(), and pocketmine\block\tile\TileFactory\register().
|
static |
|
static |
Verifies that the given callable is compatible with the desired signature. Throws a TypeError if they are incompatible.
callable | CallbackType | $signature | Dummy callable with the required parameters and return type |
callable | $subject | Callable to check the signature of @phpstan-param anyCallable|CallbackType $signature @phpstan-param anyCallable $subject |
DaveRandom\CallbackValidator\InvalidCallbackException
TypeError
Definition at line 571 of file Utils.php.
Referenced by pocketmine\inventory\CallbackInventoryListener\__construct(), pocketmine\scheduler\ClosureTask\__construct(), pocketmine\item\enchantment\Enchantment\__construct(), and pocketmine\entity\EntityFactory\register().