BlockGrowEvent: add player information for bonemeal usage (#5596)

this is in line with StructureGrowEvent, which also has a similar API.
This commit is contained in:
Hugo_
2023-05-08 18:38:07 +02:00
committed by GitHub
parent 6f0eb019d2
commit d834266635
5 changed files with 26 additions and 8 deletions

View File

@ -69,7 +69,7 @@ abstract class Crops extends Flowable{
$block->age = self::MAX_AGE;
}
$ev = new BlockGrowEvent($this, $block);
$ev = new BlockGrowEvent($this, $block, $player);
$ev->call();
if(!$ev->isCancelled()){
$this->position->getWorld()->setBlock($this->position, $ev->getNewState());