mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 15:36:08 +00:00
Fixed spawning on top of chunks & added Player::teleport() method
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user