Removed the need for paintings to check for destruction on schedule

Since we have a mechanism for triggering things on entities anyway, make use of it to do more than just forcing movement updates.
This commit is contained in:
Dylan K. Taylor
2018-03-25 13:15:10 +01:00
parent 924334a776
commit c0c684b12e
3 changed files with 22 additions and 31 deletions

View File

@ -1375,6 +1375,11 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
$this->level->updateEntities[$this->id] = $this;
}
public function onNearbyBlockChange() : void{
$this->setForceMovementUpdate();
$this->scheduleUpdate();
}
/**
* Flags the entity as needing a movement update on the next tick. Setting this forces a movement update even if the
* entity's motion is zero. Used to trigger movement updates when blocks change near entities.