mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 00:39:45 +00:00
Merge branch 'release/3.5'
This commit is contained in:
commit
e0558d2551
@ -230,7 +230,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
/** @var int */
|
||||
protected $spawnThreshold;
|
||||
/** @var int */
|
||||
protected $chunkLoadCount = 0;
|
||||
protected $spawnChunkLoadCount = 0;
|
||||
/** @var int */
|
||||
protected $chunksPerTick;
|
||||
|
||||
@ -904,7 +904,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
}
|
||||
|
||||
$this->usedChunks[Level::chunkHash($x, $z)] = true;
|
||||
$this->chunkLoadCount++;
|
||||
|
||||
$this->networkSession->queueCompressed($promise);
|
||||
|
||||
@ -914,7 +913,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$entity->spawnTo($this);
|
||||
}
|
||||
}
|
||||
}elseif($this->chunkLoadCount >= $this->spawnThreshold){
|
||||
}elseif(++$this->spawnChunkLoadCount >= $this->spawnThreshold){
|
||||
$this->spawnChunkLoadCount = -1;
|
||||
$this->spawned = true;
|
||||
|
||||
foreach($this->usedChunks as $index => $c){
|
||||
|
@ -629,6 +629,9 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
* @param float $value
|
||||
*/
|
||||
public function setScale(float $value) : void{
|
||||
if($value <= 0){
|
||||
throw new \InvalidArgumentException("Scale must be greater than 0");
|
||||
}
|
||||
$multiplier = $value / $this->getScale();
|
||||
|
||||
$this->width *= $multiplier;
|
||||
|
@ -455,13 +455,14 @@ class Level implements ChunkManager, Metadatable{
|
||||
if(!is_array($pk)){
|
||||
$pk = [$pk];
|
||||
}
|
||||
|
||||
if($players === null){
|
||||
foreach($pk as $e){
|
||||
$this->broadcastPacketToViewers($sound, $e);
|
||||
if(!empty($pk)){
|
||||
if($players === null){
|
||||
foreach($pk as $e){
|
||||
$this->broadcastPacketToViewers($sound, $e);
|
||||
}
|
||||
}else{
|
||||
$this->server->broadcastPackets($players, $pk);
|
||||
}
|
||||
}else{
|
||||
$this->server->broadcastPackets($players, $pk);
|
||||
}
|
||||
}
|
||||
|
||||
@ -470,13 +471,14 @@ class Level implements ChunkManager, Metadatable{
|
||||
if(!is_array($pk)){
|
||||
$pk = [$pk];
|
||||
}
|
||||
|
||||
if($players === null){
|
||||
foreach($pk as $e){
|
||||
$this->broadcastPacketToViewers($particle, $e);
|
||||
if(!empty($pk)){
|
||||
if($players === null){
|
||||
foreach($pk as $e){
|
||||
$this->broadcastPacketToViewers($particle, $e);
|
||||
}
|
||||
}else{
|
||||
$this->server->broadcastPackets($players, $pk);
|
||||
}
|
||||
}else{
|
||||
$this->server->broadcastPackets($players, $pk);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user