From 4564765470ab4f8acf3f0c10a98d95754c206480 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Thu, 16 May 2013 19:39:15 +0200 Subject: [PATCH] Added "player.teleport" --- src/Player.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Player.php b/src/Player.php index 849131c172..751940e77c 100644 --- a/src/Player.php +++ b/src/Player.php @@ -599,13 +599,17 @@ class Player{ if($pitch === false){ $pitch = $this->entity->pitch; } + if($this->server->api->dhandle("player.teleport", array("player" => $this, "target" => $pos)) === false){ + return false; + } + $this->lastCorrect = $pos; $this->entity->fallY = false; $this->entity->fallStart = false; $this->entity->setPosition($pos, $yaw, $pitch); $this->entity->resetSpeed(); $this->entity->updateLast(); - $this->entity->calculateVelocity(); + $this->entity->calculateVelocity(); if($pos instanceof Position and $pos->level !== $this->level){ foreach($this->server->api->entity->getAll($this->level) as $e){ if($e !== $this->entity){