mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Player: avoid unnecessary network updates on repeated calls to setAllowFLight(), setHasBlockCollision() and setAutoJump()
This commit is contained in:
parent
e0a6bc1d4a
commit
207f7ec309
@ -396,18 +396,22 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
}
|
||||
|
||||
public function setAllowFlight(bool $value) : void{
|
||||
if($this->allowFlight !== $value){
|
||||
$this->allowFlight = $value;
|
||||
$this->getNetworkSession()->syncAdventureSettings($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllowFlight() : bool{
|
||||
return $this->allowFlight;
|
||||
}
|
||||
|
||||
public function setHasBlockCollision(bool $value) : void{
|
||||
if($this->blockCollision !== $value){
|
||||
$this->blockCollision = $value;
|
||||
$this->getNetworkSession()->syncAdventureSettings($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function hasBlockCollision() : bool{
|
||||
return $this->blockCollision;
|
||||
@ -426,9 +430,11 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
}
|
||||
|
||||
public function setAutoJump(bool $value) : void{
|
||||
if($this->autoJump !== $value){
|
||||
$this->autoJump = $value;
|
||||
$this->getNetworkSession()->syncAdventureSettings($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function hasAutoJump() : bool{
|
||||
return $this->autoJump;
|
||||
|
Loading…
x
Reference in New Issue
Block a user