mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Entity: don't rebuild metadata every tick unless an associated property changed
this should improve performance back to PM3 levels.
This commit is contained in:
@ -594,6 +594,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
|
||||
public function setUsingItem(bool $value) : void{
|
||||
$this->startAction = $value ? $this->server->getTick() : -1;
|
||||
$this->networkPropertiesDirty = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -956,6 +957,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
}
|
||||
|
||||
$this->sleeping = $pos;
|
||||
$this->networkPropertiesDirty = true;
|
||||
|
||||
$this->setSpawn($pos);
|
||||
|
||||
@ -974,6 +976,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
(new PlayerBedLeaveEvent($this, $b))->call();
|
||||
|
||||
$this->sleeping = null;
|
||||
$this->networkPropertiesDirty = true;
|
||||
|
||||
$this->getWorld()->setSleepTicks(0);
|
||||
|
||||
|
Reference in New Issue
Block a user