mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Modernize property type declarations
This commit is contained in:
@ -35,30 +35,22 @@ use pocketmine\player\Player;
|
||||
class BlockBreakEvent extends BlockEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/** @var Player */
|
||||
protected $player;
|
||||
|
||||
/** @var Item */
|
||||
protected $item;
|
||||
|
||||
/** @var bool */
|
||||
protected $instaBreak = false;
|
||||
/** @var Item[] */
|
||||
protected $blockDrops = [];
|
||||
/** @var int */
|
||||
protected $xpDrops;
|
||||
protected array $blockDrops = [];
|
||||
|
||||
/**
|
||||
* @param Item[] $drops
|
||||
*/
|
||||
public function __construct(Player $player, Block $block, Item $item, bool $instaBreak = false, array $drops = [], int $xpDrops = 0){
|
||||
public function __construct(
|
||||
protected Player $player,
|
||||
Block $block,
|
||||
protected Item $item,
|
||||
protected bool $instaBreak = false,
|
||||
array $drops = [],
|
||||
protected int $xpDrops = 0
|
||||
){
|
||||
parent::__construct($block);
|
||||
$this->item = $item;
|
||||
$this->player = $player;
|
||||
|
||||
$this->instaBreak = $instaBreak;
|
||||
$this->setDrops($drops);
|
||||
$this->xpDrops = $xpDrops;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,12 +30,9 @@ use pocketmine\block\Block;
|
||||
use pocketmine\event\Event;
|
||||
|
||||
abstract class BlockEvent extends Event{
|
||||
/** @var Block */
|
||||
protected $block;
|
||||
|
||||
public function __construct(Block $block){
|
||||
$this->block = $block;
|
||||
}
|
||||
public function __construct(
|
||||
protected Block $block
|
||||
){}
|
||||
|
||||
public function getBlock() : Block{
|
||||
return $this->block;
|
||||
|
@ -35,23 +35,14 @@ use pocketmine\player\Player;
|
||||
class BlockPlaceEvent extends BlockEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/** @var Player */
|
||||
protected $player;
|
||||
|
||||
/** @var Item */
|
||||
protected $item;
|
||||
|
||||
/** @var Block */
|
||||
protected $blockReplace;
|
||||
/** @var Block */
|
||||
protected $blockAgainst;
|
||||
|
||||
public function __construct(Player $player, Block $blockPlace, Block $blockReplace, Block $blockAgainst, Item $item){
|
||||
public function __construct(
|
||||
protected Player $player,
|
||||
Block $blockPlace,
|
||||
protected Block $blockReplace,
|
||||
protected Block $blockAgainst,
|
||||
protected Item $item
|
||||
){
|
||||
parent::__construct($blockPlace);
|
||||
$this->blockReplace = $blockReplace;
|
||||
$this->blockAgainst = $blockAgainst;
|
||||
$this->item = $item;
|
||||
$this->player = $player;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user