Entity: Clear dirty properties at the end of the constructor

this prevents sending duplicate properties immediately after entity spawn (due to properties getting set in the constructor).
This commit is contained in:
Dylan K. Taylor 2018-06-04 11:18:42 +01:00
parent fe21f0e916
commit 0d177d5219

View File

@ -556,6 +556,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
$this->chunk->addEntity($this);
$this->level->addEntity($this);
$this->initEntity();
$this->propertyManager->clearDirtyProperties(); //Prevents resending properties that were set during construction
$this->lastUpdate = $this->server->getTick();
$this->server->getPluginManager()->callEvent(new EntitySpawnEvent($this));