diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index e047edd0e..ecbe50be3 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -647,6 +647,12 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ } $this->spawned = true; + + $this->sendSettings(); + $this->sendData($this); + $this->sendPotionEffects($this); + $this->inventory->sendContents($this); + $this->inventory->sendArmorContents($this); $pk = new PlayStatusPacket(); $pk->status = PlayStatusPacket::PLAYER_SPAWN; @@ -663,12 +669,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->teleport($ev->getRespawnPosition()); - $this->sendSettings(); - $this->sendData($this); - $this->sendPotionEffects($this); - $this->inventory->sendContents($this); - $this->inventory->sendArmorContents($this); - $this->server->getPluginManager()->callEvent($ev = new PlayerJoinEvent($this, TextFormat::YELLOW . $this->getName() . " joined the game")); if(strlen(trim($ev->getJoinMessage())) > 0){ $this->server->broadcastMessage($ev->getJoinMessage()); diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 124ba5531..7734a870e 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -76,6 +76,7 @@ abstract class Entity extends Location implements Metadatable{ const DATA_TYPE_SLOT = 5; const DATA_TYPE_POS = 6; const DATA_TYPE_ROTATION = 7; + const DATA_TYPE_LONG = 8; const DATA_FLAGS = 0; const DATA_AIR = 1; diff --git a/src/pocketmine/utils/Binary.php b/src/pocketmine/utils/Binary.php index 9e6ba28e9..a06a80a7b 100644 --- a/src/pocketmine/utils/Binary.php +++ b/src/pocketmine/utils/Binary.php @@ -116,6 +116,9 @@ class Binary{ $m .= self::writeLInt($d[1][1]); $m .= self::writeLInt($d[1][2]); break; + case Entity::DATA_TYPE_LONG: + $m .= self::writeLLong($d[1]); + break; } } $m .= "\x7f"; @@ -179,6 +182,10 @@ class Binary{ $offset += 4; } break; + case Entity::DATA_TYPE_LONG: + $r = self::readLLong(substr($value, $offset, 4)); + $offset += 8; + break; default: return []; @@ -430,4 +437,4 @@ class Binary{ return strrev(self::writeLong($value)); } -} \ No newline at end of file +}