Updated for MCPE 0.9.0 build 7

This commit is contained in:
Shoghi Cervantes 2014-06-23 21:50:07 +02:00
parent 38a958ed08
commit 22533458ed
4 changed files with 16 additions and 14 deletions

View File

@ -1186,12 +1186,19 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$pk->status = 0;
$this->directDataPacket($pk);
if(($level = $this->server->getLevelByName($this->namedtag["SpawnLevel"])) instanceof Level){
$this->spawnPosition = new Position($this->namedtag["SpawnX"], $this->namedtag["SpawnY"], $this->namedtag["SpawnZ"], $level);
}
$pk = new StartGamePacket;
$pk->seed = $this->getLevel()->getSeed();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->generator = 2; //0 ??, 1 ??, 2 infinite
$pk->spawnX = (int) $this->spawnPosition->x;
$pk->spawnY = (int) $this->spawnPosition->y;
$pk->spawnZ = (int) $this->spawnPosition->z;
$pk->generator = 1; //0 old, 1 infinite, 2 flat
$pk->gamemode = $this->gamemode & 0x01;
$pk->eid = 0; //Always use EntityID as zero for the actual player
$this->directDataPacket($pk);
@ -1200,17 +1207,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$pk->time = $this->getLevel()->getTime();
$this->directDataPacket($pk);
if(($level = $this->server->getLevelByName($this->namedtag["SpawnLevel"])) instanceof Level){
$this->spawnPosition = new Position($this->namedtag["SpawnX"], $this->namedtag["SpawnY"], $this->namedtag["SpawnZ"], $level);
$pk = new SetSpawnPositionPacket;
$pk->x = (int) $this->spawnPosition->x;
$pk->y = (int) $this->spawnPosition->y;
$pk->z = (int) $this->spawnPosition->z;
$this->dataPacket($pk);
}
$this->server->getLogger()->info(TextFormat::AQUA . $this->username . TextFormat::WHITE . "[/" . $this->ip . ":" . $this->port . "] logged in with entity id " . $this->id . " at (" . $this->getLevel()->getName() . ", " . round($this->x, 4) . ", " . round($this->y, 4) . ", " . round($this->z, 4) . ")");

View File

@ -75,7 +75,7 @@ namespace pocketmine {
const VERSION = "Alpha_1.4dev";
const API_VERSION = "1.0.0";
const CODENAME = "絶好(Zekkou)ケーキ(Cake)";
const MINECRAFT_VERSION = "v0.9.0 alpha build 6";
const MINECRAFT_VERSION = "v0.9.0 alpha build 7";
const PHP_VERSION = "5.5";
if(\Phar::running(true) !== ""){

View File

@ -30,7 +30,7 @@ interface Info{
/**
* Actual Minecraft: PE protocol version
*/
const CURRENT_PROTOCOL = 15;
const CURRENT_PROTOCOL = 16;
const LOGIN_PACKET = 0x82;

View File

@ -27,6 +27,9 @@ class StartGamePacket extends DataPacket{
public $generator;
public $gamemode;
public $eid;
public $spawnX;
public $spawnY;
public $spawnZ;
public $x;
public $y;
public $z;
@ -45,6 +48,9 @@ class StartGamePacket extends DataPacket{
$this->putInt($this->generator);
$this->putInt($this->gamemode);
$this->putInt($this->eid);
$this->putInt($this->spawnX);
$this->putInt($this->spawnY);
$this->putInt($this->spawnZ);
$this->putFloat($this->x);
$this->putFloat($this->y);
$this->putFloat($this->z);