mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Possible fix for #2245
This commit is contained in:
parent
6b6222c09c
commit
abbd33210a
@ -1862,7 +1862,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function unloadChunk($x, $z, $safe = true){
|
public function unloadChunk($x, $z, $safe = true){
|
||||||
if($safe === true and $this->isChunkInUse($x, $z)){
|
if(($safe === true and $this->isChunkInUse($x, $z)) or $this->isChunkLoaded($x, $z)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1872,7 +1872,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
$chunk = $this->getChunk($x, $z);
|
$chunk = $this->getChunk($x, $z);
|
||||||
|
|
||||||
if($chunk instanceof FullChunk){
|
if($chunk instanceof FullChunk and $chunk->getProvider() !== null){
|
||||||
$this->server->getPluginManager()->callEvent($ev = new ChunkUnloadEvent($chunk));
|
$this->server->getPluginManager()->callEvent($ev = new ChunkUnloadEvent($chunk));
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user