GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
BlockBreakEvent Class Reference

Public Member Functions

 __construct (Player $player, Block $block, Item $item, $instaBreak=false)
 
 getPlayer ()
 
 getItem ()
 
 getInstaBreak ()
 
 getDrops ()
 
 setDrops (array $drops)
 
 setInstaBreak ($instaBreak)
 
- Public Member Functions inherited from BlockEvent
 __construct (Block $block)
 
 getBlock ()
 
- Public Member Functions inherited from Event
 getEventName ()
 
 getHandlers ()
 
- Public Member Functions inherited from Cancellable
 isCancelled ()
 
 setCancelled ($forceCancel=false)
 

Static Public Attributes

static $handlerList = null
 

Protected Attributes

 $player
 
 $item
 
 $instaBreak = false
 
 $blockDrops = []
 
- Protected Attributes inherited from BlockEvent
 $block
 
- Protected Attributes inherited from Event
 $eventName = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( Player  $player,
Block  $block,
Item  $item,
  $instaBreak = false 
)

BlockBreakEvent constructor.

Parameters
Player$player
Block$block
Item$item
bool$instaBreak
50  {
51  $this->block = $block;
52  $this->item = $item;
53  $this->player = $player;
54  $this->instaBreak = (bool) $instaBreak;
55  $drops = $player->isSurvival() ? $block->getDrops($item) : [];
56  if($drops != null && is_numeric($drops[0]))
57  $this->blockDrops[] = Item::get($drops[0], $drops[1], $drops[2]);
58  else
59  foreach($drops as $i){
60  $this->blockDrops[] = Item::get($i[0], $i[1], $i[2]);
61  }
62  }

Member Function Documentation

◆ getDrops()

getDrops ( )
Returns
Item[]
88  {
89  return $this->blockDrops;
90  }

◆ getInstaBreak()

getInstaBreak ( )
Returns
bool
81  {
82  return $this->instaBreak;
83  }

◆ getItem()

getItem ( )
Returns
Item
74  {
75  return $this->item;
76  }

◆ getPlayer()

getPlayer ( )
Returns
Player
67  {
68  return $this->player;
69  }

◆ setDrops()

setDrops ( array  $drops)
Parameters
Item[]$drops
95  {
96  $this->blockDrops = $drops;
97  }

◆ setInstaBreak()

setInstaBreak (   $instaBreak)
Parameters
bool$instaBreak
102  {
103  $this->instaBreak = (bool) $instaBreak;
104  }

Field Documentation

◆ $blockDrops

$blockDrops = []
protected

◆ $handlerList

$handlerList = null
static

◆ $instaBreak

$instaBreak = false
protected

◆ $item

$item
protected

◆ $player

$player
protected

The documentation for this class was generated from the following file: