Entity: rewrite dbbe1f2d5c04059ee9ddad12a0d33fbaea933683 for master

This commit is contained in:
Dylan K. Taylor 2019-12-03 12:16:10 +00:00
parent 54c2778e56
commit 5b91be81cc

View File

@ -1633,7 +1633,7 @@ abstract class Entity{
*/
public function spawnTo(Player $player) : void{
$id = spl_object_id($player);
if(!isset($this->hasSpawned[$id])){
if(!isset($this->hasSpawned[$id]) and $player->isUsingChunk($this->location->getFloorX() >> 4, $this->location->getFloorZ() >> 4)){
$this->hasSpawned[$id] = $player;
$this->sendSpawnPacket($player);