Entity: remove redundant check from spawnTo()

this won't be reached if the player isn't using this chunk anyway.
This commit is contained in:
Dylan K. Taylor 2018-10-20 16:24:46 +01:00
parent 9f8a2dc61a
commit 3028832cd3

View File

@ -1952,7 +1952,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
* @param Player $player
*/
public function spawnTo(Player $player) : void{
if(!isset($this->hasSpawned[$player->getLoaderId()]) and $this->chunk !== null and isset($player->usedChunks[Level::chunkHash($this->chunk->getX(), $this->chunk->getZ())])){
if(!isset($this->hasSpawned[$player->getLoaderId()])){
$this->hasSpawned[$player->getLoaderId()] = $player;
$this->sendSpawnPacket($player);