Skip to content

RegistryTrait ​

trait · pocketmine\utils\RegistryTrait · source

Deprecated

Superseded by RegistrySource

This trait allows a class to simulate object class constants, since PHP doesn't currently support this. These faux constants are exposed in static class methods, which are handled using __callStatic().

Classes using this trait need to include @method tags in their class docblock for every faux constant. Alternatively, just put @generate-registry-docblock in the docblock and run build/codegen/registry-annotations.php

Methods ​

__callStatic() ​

php
public static function __callStatic($name, $arguments)

preprocessMember() protected ​

php
protected static function preprocessMember(object $member) : object

setup() protected ​

php
abstract protected static function setup() : void

Inserts default entries into the registry.

(This ought to be private, but traits suck too much for that.)

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.