pocketmine\Player::__construct PHP Method

__construct() public method

public __construct ( pocketmine\network\SourceInterface $interface, null $clientID, string $ip, integer $port )
$interface pocketmine\network\SourceInterface
$clientID null
$ip string
$port integer
    public function __construct(SourceInterface $interface, $clientID, $ip, $port)
    {
        $this->interface = $interface;
        $this->windows = new \SplObjectStorage();
        $this->perm = new PermissibleBase($this);
        $this->namedtag = new CompoundTag();
        $this->server = Server::getInstance();
        $this->lastBreak = PHP_INT_MAX;
        $this->ip = $ip;
        $this->port = $port;
        $this->clientID = $clientID;
        $this->loaderId = Level::generateChunkLoaderId($this);
        $this->chunksPerTick = (int) $this->server->getProperty("chunk-sending.per-tick", 4);
        $this->spawnThreshold = (int) $this->server->getProperty("chunk-sending.spawn-threshold", 56);
        $this->spawnPosition = null;
        $this->gamemode = $this->server->getGamemode();
        $this->setLevel($this->server->getDefaultLevel());
        $this->viewDistance = $this->server->getViewDistance();
        $this->newPosition = new Vector3(0, 0, 0);
        $this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
        $this->uuid = null;
        $this->rawUUID = null;
        $this->creationTime = microtime(true);
        $this->exp = 0;
        $this->expLevel = 0;
        $this->food = 20;
        Entity::setHealth(20);
    }

Usage Example

示例#1
0
 public function __construct(SourceInterface $interface, $clientID, $address, $port, BigBrother $plugin)
 {
     $this->plugin = $plugin;
     $this->bigbrother_clientId = $clientID;
     parent::__construct($interface, $clientID, $address, $port);
     $this->setRemoveFormat(false);
     // Color Code
 }
All Usage Examples Of pocketmine\Player::__construct
Player