mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
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:
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user