mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +00:00
Faster respawn when needed
This commit is contained in:
parent
c8abbf4f2f
commit
1e2038fac5
@ -562,8 +562,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
public function setSkin($str, $isSlim = false){
|
public function setSkin($str, $isSlim = false){
|
||||||
parent::setSkin($str, $isSlim);
|
parent::setSkin($str, $isSlim);
|
||||||
if($this->spawned === true){
|
if($this->spawned === true){
|
||||||
$this->despawnFromAll();
|
$this->respawnToAll();
|
||||||
$this->spawnToAll();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1465,6 +1465,13 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function respawnToAll(){
|
||||||
|
foreach($this->hasSpawned as $key => $player){
|
||||||
|
unset($this->hasSpawned[$key]);
|
||||||
|
$this->spawnTo($player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function spawnToAll(){
|
public function spawnToAll(){
|
||||||
if($this->chunk === null){
|
if($this->chunk === null){
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user