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

@ -96,6 +96,7 @@ class Arrow extends Projectile{
public function setCritical(bool $value = true) : void{
$this->critical = $value;
$this->networkPropertiesDirty = true;
}
public function getResultDamage() : int{

View File

@ -150,6 +150,7 @@ class SplashPotion extends Throwable{
public function setPotionId(int $id) : void{
$this->potionId = $id; //TODO: validation
$this->networkPropertiesDirty = true;
}
/**
@ -164,6 +165,7 @@ class SplashPotion extends Throwable{
*/
public function setLinger(bool $value = true) : void{
$this->linger = $value;
$this->networkPropertiesDirty = true;
}
/**