Force chunk resend on teleport

This commit is contained in:
Shoghi Cervantes Pueyo 2013-03-31 13:50:13 +02:00
parent b83ef4e70b
commit 66169d63c4

View File

@ -491,6 +491,8 @@ class Player{
$this->entity->setPosition($pos->x, $pos->y, $pos->z, $yaw, $pitch); $this->entity->setPosition($pos->x, $pos->y, $pos->z, $yaw, $pitch);
$this->entity->updateLast(); $this->entity->updateLast();
$this->entity->calculateVelocity(); $this->entity->calculateVelocity();
$this->orderChunks();
$this->getNextChunk();
} }
$this->dataPacket(MC_MOVE_PLAYER, array( $this->dataPacket(MC_MOVE_PLAYER, array(
"eid" => 0, "eid" => 0,
@ -751,12 +753,15 @@ class Player{
$this->eventHandler("You're using the default username. Please change it on the Minecraft PE settings.", "server.chat"); $this->eventHandler("You're using the default username. Please change it on the Minecraft PE settings.", "server.chat");
} }
$this->sendInventory(); $this->sendInventory();
$this->teleport(new Vector3($this->data->get("position")["x"], $this->data->get("position")["y"], $this->data->get("position")["z"]));
$this->sendSettings(); $this->sendSettings();
$this->orderChunks();
$this->server->schedule(50, array($this, "orderChunks"), array(), true); $this->server->schedule(50, array($this, "orderChunks"), array(), true);
$this->getNextChunk();
$this->blocked = false; $this->blocked = false;
$this->teleport(new Vector3($this->data->get("position")["x"], $this->data->get("position")["y"], $this->data->get("position")["z"]));
$this->dataPacket(MC_SET_SPAWN_POSITION, array(
"x" => (int) $this->server->spawn["x"],
"y" => (int) $this->server->spawn["y"],
"z" => (int) $this->server->spawn["z"],
));
break; break;
case 2://Chunk loaded? case 2://Chunk loaded?
break; break;
@ -851,9 +856,9 @@ class Player{
} }
$this->entity->fire = 0; $this->entity->fire = 0;
$this->entity->air = 300; $this->entity->air = 300;
$this->teleport(new Vector3($this->server->spawn["x"], $this->server->spawn["y"], $this->server->spawn["z"]));
$this->entity->setHealth(20, "respawn"); $this->entity->setHealth(20, "respawn");
$this->entity->updateMetadata(); $this->entity->updateMetadata();
$this->teleport(new Vector3($this->server->spawn["x"], $this->server->spawn["y"], $this->server->spawn["z"]));
break; break;
case MC_SET_HEALTH: case MC_SET_HEALTH:
if($this->loggedIn === false){ if($this->loggedIn === false){