Fixed confusing hierarchy of BlockGrow/Form/SpreadEvent, closes #2792

This commit is contained in:
Dylan K. Taylor
2021-05-19 00:16:30 +01:00
parent 4122517292
commit f8cfa191dd
4 changed files with 49 additions and 17 deletions

View File

@ -23,25 +23,11 @@ declare(strict_types=1);
namespace pocketmine\event\block;
use pocketmine\block\Block;
use pocketmine\event\Cancellable;
use pocketmine\event\CancellableTrait;
/**
* Called when plants or crops grow.
*/
class BlockGrowEvent extends BlockEvent implements Cancellable{
use CancellableTrait;
class BlockGrowEvent extends BaseBlockChangeEvent implements Cancellable{
/** @var Block */
private $newState;
public function __construct(Block $block, Block $newState){
parent::__construct($block);
$this->newState = $newState;
}
public function getNewState() : Block{
return $this->newState;
}
}