mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Use newly added API method
This commit is contained in:
parent
43426a4c5c
commit
4aef9919dc
@ -1804,7 +1804,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
$this->chunk = $this->level->getChunk($chunkX, $chunkZ, true);
|
||||
|
||||
if(!$this->justCreated){
|
||||
$newChunk = $this->level->getChunkPlayers($chunkX, $chunkZ);
|
||||
$newChunk = $this->level->getViewersForPosition($this);
|
||||
foreach($this->hasSpawned as $player){
|
||||
if(!isset($newChunk[$player->getLoaderId()])){
|
||||
$this->despawnFrom($player);
|
||||
@ -1963,7 +1963,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
if($this->chunk === null or $this->closed){
|
||||
return;
|
||||
}
|
||||
foreach($this->level->getChunkPlayers($this->chunk->getX(), $this->chunk->getZ()) as $player){
|
||||
foreach($this->level->getViewersForPosition($this) as $player){
|
||||
if($player->isOnline()){
|
||||
$this->spawnTo($player);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user