Fixed spawning on top of chunks & added Player::teleport() method

This commit is contained in:
Shoghi Cervantes Pueyo
2013-03-16 19:36:30 +01:00
parent ed003cd207
commit 47af98a875
2 changed files with 65 additions and 57 deletions

View File

@@ -178,19 +178,7 @@ class PlayerAPI{
public function tppos($name, $x, $y, $z){
$player = $this->get($name);
if(($player instanceof Player) and ($player->entity instanceof Entity)){
$player->entity->setPosition($x, $y, $z, 0, 0);
$player->fallY = false;
$player->fallStart = false;
$player->dataPacket(MC_MOVE_PLAYER, array(
"eid" => 0,
"x" => $x,
"y" => $y,
"z" => $z,
"yaw" => 0,
"pitch" => 0,
));
$player->fallY = false;
$player->fallStart = false;
$player->teleport(new Vector3($x, $y, $z));
return true;
}
return false;