Spawn working on new build. TODO: Resource packs.

This commit is contained in:
Dylan K. Taylor
2016-10-11 22:31:13 +01:00
parent 9a12aa689e
commit 7cd7a7fbf6
5 changed files with 148 additions and 3 deletions

View File

@ -114,6 +114,7 @@ use pocketmine\network\protocol\InteractPacket;
use pocketmine\network\protocol\MovePlayerPacket;
use pocketmine\network\protocol\PlayerActionPacket;
use pocketmine\network\protocol\PlayStatusPacket;
use pocketmine\network\protocol\ResourcePacksInfoPacket;
use pocketmine\network\protocol\RespawnPacket;
use pocketmine\network\protocol\SetDifficultyPacket;
use pocketmine\network\protocol\SetEntityMotionPacket;
@ -1644,9 +1645,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->inventory->setHeldItemSlot($this->inventory->getHotbarSlotIndex(0));
}
$pk = new PlayStatusPacket();
$pk->status = PlayStatusPacket::LOGIN_SUCCESS;
$this->dataPacket($pk);
$this->dataPacket(new ResourcePacksInfoPacket());
if($this->spawnPosition === null and isset($this->namedtag->SpawnLevel) and ($level = $this->server->getLevelByName($this->namedtag["SpawnLevel"])) instanceof Level){
$this->spawnPosition = new Position($this->namedtag["SpawnX"], $this->namedtag["SpawnY"], $this->namedtag["SpawnZ"], $level);