Entity: Invalid blocksAround cache when something happens during onEntityInside()

this fixes TNT spawning multiple entities when lit by flaming arrows.
The problem here is a bit more complex (entities aren't immediately notified when local block updates happen, so they cache stuff that becomes unusable). The simplest option would be to just lose the cache, but that would have some impacts on performance.
Barring a rethink of the block updating mechanism, this solution seems usable for now.
This commit is contained in:
Dylan K. Taylor
2020-09-25 16:35:59 +01:00
parent ae9e931849
commit 8e12693494
12 changed files with 29 additions and 13 deletions

View File

@ -536,9 +536,12 @@ class Block{
/**
* Called when an entity's bounding box clips inside this block's cell. Note that the entity may not be intersecting
* with the collision box or bounding box.
*
* @return bool Whether the block is still the same after the intersection. If it changed (e.g. due to an explosive
* being ignited), this should return false.
*/
public function onEntityInside(Entity $entity) : void{
public function onEntityInside(Entity $entity) : bool{
return true;
}
/**