mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Spawning mechanics change
This commit is contained in:
parent
547aa2ae31
commit
bd560ab3b1
@ -276,7 +276,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
* @param Player $player
|
* @param Player $player
|
||||||
*/
|
*/
|
||||||
public function spawnTo(Player $player){
|
public function spawnTo(Player $player){
|
||||||
if($this->spawned === true and $this->dead !== true and $player->dead !== true and $player->getLevel() === $this->level and $player->canSee($this)){
|
if($this->spawned === true and $player->spawned === true and $this->dead !== true and $player->dead !== true and $player->getLevel() === $this->level and $player->canSee($this)){
|
||||||
parent::spawnTo($player);
|
parent::spawnTo($player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -591,9 +591,11 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$pk->data = $payload;
|
$pk->data = $payload;
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
|
|
||||||
foreach($this->level->getChunkEntities($x, $z) as $entity){
|
if($this->spawned){
|
||||||
if($entity !== $this and !$entity->closed and !$entity->dead){
|
foreach($this->level->getChunkEntities($x, $z) as $entity){
|
||||||
$entity->spawnTo($this);
|
if($entity !== $this and !$entity->closed and !$entity->dead){
|
||||||
|
$entity->spawnTo($this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -662,6 +664,15 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
$this->noDamageTicks = 60;
|
$this->noDamageTicks = 60;
|
||||||
|
|
||||||
|
foreach($this->usedChunks as $index => $c){
|
||||||
|
Level::getXZ($index, $chunkX, $chunkZ);
|
||||||
|
foreach($this->level->getChunkEntities($chunkX, $chunkZ) as $entity){
|
||||||
|
if($entity !== $this and !$entity->closed and !$entity->dead){
|
||||||
|
$entity->spawnTo($this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->spawnToAll();
|
$this->spawnToAll();
|
||||||
|
|
||||||
if($this->server->getUpdater()->hasUpdate() and $this->hasPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE)){
|
if($this->server->getUpdater()->hasUpdate() and $this->hasPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user