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

@ -1549,8 +1549,7 @@ class Level implements ChunkManager, Metadatable{
$this->server->getPluginManager()->callEvent($ev = new BlockUpdateEvent($block));
if(!$ev->isCancelled()){
foreach($this->getNearbyEntities(new AxisAlignedBB($block->x - 1, $block->y - 1, $block->z - 1, $block->x + 2, $block->y + 2, $block->z + 2)) as $entity){
$entity->setForceMovementUpdate();
$entity->scheduleUpdate();
$entity->onNearbyBlockChange();
}
$ev->getBlock()->onNearbyBlockChange();
$this->scheduleNeighbourBlockUpdates($pos);