mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +00:00
Fixed players and entities getting despawned
This commit is contained in:
parent
fd4fc4ff94
commit
31a7410acd
@ -610,8 +610,9 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
$pk->started = $this->getLevel()->stopTime == false;
|
$pk->started = $this->getLevel()->stopTime == false;
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
}
|
}
|
||||||
$this->spawnToAll();
|
|
||||||
$this->chunk = null;
|
$this->chunk = null;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPosition(){
|
public function getPosition(){
|
||||||
|
@ -275,7 +275,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
public function useChunk($X, $Z, Player $player){
|
public function useChunk($X, $Z, Player $player){
|
||||||
$index = Level::chunkHash($X, $Z);
|
$index = Level::chunkHash($X, $Z);
|
||||||
$this->loadChunk($X, $Z);
|
$this->loadChunk($X, $Z);
|
||||||
$this->usedChunks[$index][spl_object_hash($player)] = $player;
|
$this->usedChunks[$index][$player->getID()] = $player;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -299,7 +299,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
* @param Player $player
|
* @param Player $player
|
||||||
*/
|
*/
|
||||||
public function freeChunk($X, $Z, Player $player){
|
public function freeChunk($X, $Z, Player $player){
|
||||||
unset($this->usedChunks[Level::chunkHash($X, $Z)][spl_object_hash($player)]);
|
unset($this->usedChunks[Level::chunkHash($X, $Z)][$player->getID()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user