mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-09 21:24:53 +00:00
World: add notifyNeighbourBlockUpdate() to allow triggering neighbour block updates on blocks manually
this can be useful if blocks were modified asynchronously.
This commit is contained in:
parent
ac55b21fb4
commit
72fb49b356
@ -1164,6 +1164,17 @@ class World implements ChunkManager{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify the blocks at and around the position that the block at the position may have changed.
|
||||
* This will cause onNeighbourBlockUpdate() to be called for these blocks.
|
||||
*/
|
||||
public function notifyNeighbourBlockUpdate(Vector3 $pos) : void{
|
||||
$this->tryAddToNeighbourUpdateQueue($pos);
|
||||
foreach($pos->sides() as $side){
|
||||
$this->tryAddToNeighbourUpdateQueue($side);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Block[]
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user