mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +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);
|
$this->chunk = $this->level->getChunk($chunkX, $chunkZ, true);
|
||||||
|
|
||||||
if(!$this->justCreated){
|
if(!$this->justCreated){
|
||||||
$newChunk = $this->level->getChunkPlayers($chunkX, $chunkZ);
|
$newChunk = $this->level->getViewersForPosition($this);
|
||||||
foreach($this->hasSpawned as $player){
|
foreach($this->hasSpawned as $player){
|
||||||
if(!isset($newChunk[$player->getLoaderId()])){
|
if(!isset($newChunk[$player->getLoaderId()])){
|
||||||
$this->despawnFrom($player);
|
$this->despawnFrom($player);
|
||||||
@ -1963,7 +1963,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
|||||||
if($this->chunk === null or $this->closed){
|
if($this->chunk === null or $this->closed){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach($this->level->getChunkPlayers($this->chunk->getX(), $this->chunk->getZ()) as $player){
|
foreach($this->level->getViewersForPosition($this) as $player){
|
||||||
if($player->isOnline()){
|
if($player->isOnline()){
|
||||||
$this->spawnTo($player);
|
$this->spawnTo($player);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user