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:
Dylan K. Taylor
2021-05-17 20:05:52 +01:00
parent bdce781c6d
commit 5a14c1cb89
8 changed files with 42 additions and 3 deletions

View File

@ -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);