PHP Class pocketmine\block\Block

Inheritance: extends pocketmine\level\Position, implements pocketmine\metadata\Metadatable
Show file Open project: iTXTech/Genisys Class Usage Examples

Public Properties

Property Type Description
$boundingBox pocketmine\math\AxisAlignedBB
$fullList SplFixedArray
$hardness SplFixedArray
$light SplFixedArray
$lightFilter SplFixedArray
$list SplFixedArray
$solid SplFixedArray
$transparent SplFixedArray

Protected Properties

Property Type Description
$id
$meta

Public Methods

Method Description
__construct ( integer $id, integer $meta )
__toString ( ) : string
activate ( )
addVelocityToEntity ( Entity $entity, Vector3 $vector )
calculateIntercept ( Vector3 $pos1, Vector3 $pos2 ) : MovingObjectPosition
canBeActivated ( ) : boolean AKA: Block->isActivable
canBeBrokenWith ( Item $item )
canBeFlowedInto ( ) : boolean AKA: Block->isFlowable
canBePlaced ( ) : boolean AKA: Block->isPlaceable
canBeReplaced ( ) : boolean AKA: Block->canBeReplaced()
canNeighborBurn ( )
canPassThrough ( )
collidesWithBB ( AxisAlignedBB $bb ) : boolean Checks for collision against an AxisAlignedBB
deactivate ( )
get ( integer $id, integer $meta, Position $pos = null ) : Block
getBoundingBox ( ) : AxisAlignedBB
getBreakTime ( Item $item ) : float Returns the seconds that this block takes to be broken using an specific Item
getBurnAbility ( ) : integer
getBurnChance ( ) : integer
getDamage ( ) : integer
getDrops ( Item $item ) : array Returns an array of Item objects to be dropped
getFrictionFactor ( ) : float
getHardness ( ) : integer
getId ( ) : integer
getLightLevel ( ) : integer
getMetadata ( $metadataKey )
getName ( ) : string
getResistance ( ) : integer
getSide ( integer $side, integer $step = 1 ) : Block Returns the Block on the side $side, works like Vector3::side()
getToolType ( ) : integer
hasEntityCollision ( )
hasMetadata ( $metadataKey )
init ( )
isActivated ( Block $from = null )
isBreakable ( Item $item ) : boolean Returns if the item can be broken with an specific Item
isPlaceable ( )
isSolid ( )
isTopFacingSurfaceSolid ( )
isTransparent ( ) : boolean
onActivate ( Item $item, Player $player = null ) : boolean Do actions when activated by Item. Returns if it has done anything
onBreak ( Item $item ) : mixed Do the actions needed so the block is broken with the Item
onEntityCollide ( Entity $entity )
onUpdate ( integer $type ) : void Fires a block update on the Block
place ( Item $item, Block $block, Block $target, integer $face, float $fx, float $fy, float $fz, Player $player = null ) : boolean Places the Block, using block space and block target, and side. Returns if the block has been placed.
position ( Position $v ) Sets the block position to a new Position object
removeMetadata ( $metadataKey, pocketmine\plugin\Plugin $plugin )
setDamage ( integer $meta )
setMetadata ( $metadataKey, MetadataValue $metadataValue )
tickRate ( ) : integer

Protected Methods

Method Description
recalculateBoundingBox ( ) : AxisAlignedBB

Method Details

__construct() public method

public __construct ( integer $id, integer $meta )
$id integer
$meta integer

__toString() public method

public __toString ( ) : string
return string

activate() public method

public activate ( )

addVelocityToEntity() public method

public addVelocityToEntity ( Entity $entity, Vector3 $vector )
$entity pocketmine\entity\Entity
$vector pocketmine\math\Vector3

calculateIntercept() public method

public calculateIntercept ( Vector3 $pos1, Vector3 $pos2 ) : MovingObjectPosition
$pos1 pocketmine\math\Vector3
$pos2 pocketmine\math\Vector3
return pocketmine\level\MovingObjectPosition

canBeActivated() public method

AKA: Block->isActivable
public canBeActivated ( ) : boolean
return boolean

canBeBrokenWith() public method

public canBeBrokenWith ( Item $item )
$item pocketmine\item\Item

canBeFlowedInto() public method

AKA: Block->isFlowable
public canBeFlowedInto ( ) : boolean
return boolean

canBePlaced() public method

AKA: Block->isPlaceable
public canBePlaced ( ) : boolean
return boolean

canBeReplaced() public method

AKA: Block->canBeReplaced()
public canBeReplaced ( ) : boolean
return boolean

canNeighborBurn() public method

public canNeighborBurn ( )

canPassThrough() public method

public canPassThrough ( )

collidesWithBB() public method

Checks for collision against an AxisAlignedBB
public collidesWithBB ( AxisAlignedBB $bb ) : boolean
$bb pocketmine\math\AxisAlignedBB
return boolean

deactivate() public method

public deactivate ( )

get() public static method

public static get ( integer $id, integer $meta, Position $pos = null ) : Block
$id integer
$meta integer
$pos pocketmine\level\Position
return Block

getBoundingBox() public method

public getBoundingBox ( ) : AxisAlignedBB
return pocketmine\math\AxisAlignedBB

getBreakTime() public method

Returns the seconds that this block takes to be broken using an specific Item
public getBreakTime ( Item $item ) : float
$item pocketmine\item\Item
return float

getBurnAbility() public method

public getBurnAbility ( ) : integer
return integer

getBurnChance() public method

public getBurnChance ( ) : integer
return integer

getDamage() final public method

final public getDamage ( ) : integer
return integer

getDrops() public method

Returns an array of Item objects to be dropped
public getDrops ( Item $item ) : array
$item pocketmine\item\Item
return array

getFrictionFactor() public method

public getFrictionFactor ( ) : float
return float

getHardness() public method

public getHardness ( ) : integer
return integer

getId() final public method

final public getId ( ) : integer
return integer

getLightLevel() public method

public getLightLevel ( ) : integer
return integer 0-15

getMetadata() public method

public getMetadata ( $metadataKey )

getName() public method

public getName ( ) : string
return string

getResistance() public method

public getResistance ( ) : integer
return integer

getSide() public method

Returns the Block on the side $side, works like Vector3::side()
public getSide ( integer $side, integer $step = 1 ) : Block
$side integer
$step integer
return Block

getToolType() public method

public getToolType ( ) : integer
return integer

hasEntityCollision() public method

public hasEntityCollision ( )

hasMetadata() public method

public hasMetadata ( $metadataKey )

init() public static method

public static init ( )

isActivated() public method

public isActivated ( Block $from = null )
$from Block

isBreakable() public method

Returns if the item can be broken with an specific Item
public isBreakable ( Item $item ) : boolean
$item pocketmine\item\Item
return boolean

isPlaceable() public method

public isPlaceable ( )

isSolid() public method

public isSolid ( )

isTopFacingSurfaceSolid() public method

isTransparent() public method

public isTransparent ( ) : boolean
return boolean

onActivate() public method

Do actions when activated by Item. Returns if it has done anything
public onActivate ( Item $item, Player $player = null ) : boolean
$item pocketmine\item\Item
$player pocketmine\Player
return boolean

onBreak() public method

Do the actions needed so the block is broken with the Item
public onBreak ( Item $item ) : mixed
$item pocketmine\item\Item
return mixed

onEntityCollide() public method

public onEntityCollide ( Entity $entity )
$entity pocketmine\entity\Entity

onUpdate() public method

Fires a block update on the Block
public onUpdate ( integer $type ) : void
$type integer
return void

place() public method

Places the Block, using block space and block target, and side. Returns if the block has been placed.
public place ( Item $item, Block $block, Block $target, integer $face, float $fx, float $fy, float $fz, Player $player = null ) : boolean
$item pocketmine\item\Item
$block Block
$target Block
$face integer
$fx float
$fy float
$fz float
$player pocketmine\Player = null
return boolean

position() final public method

Sets the block position to a new Position object
final public position ( Position $v )
$v pocketmine\level\Position

recalculateBoundingBox() protected method

protected recalculateBoundingBox ( ) : AxisAlignedBB
return pocketmine\math\AxisAlignedBB

removeMetadata() public method

public removeMetadata ( $metadataKey, pocketmine\plugin\Plugin $plugin )
$plugin pocketmine\plugin\Plugin

setDamage() final public method

final public setDamage ( integer $meta )
$meta integer

setMetadata() public method

public setMetadata ( $metadataKey, MetadataValue $metadataValue )
$metadataValue pocketmine\metadata\MetadataValue

tickRate() public method

public tickRate ( ) : integer
return integer

Property Details

$boundingBox public property

public AxisAlignedBB,pocketmine\math $boundingBox
return pocketmine\math\AxisAlignedBB

$fullList public static property

public static SplFixedArray $fullList
return SplFixedArray

$hardness public static property

public static SplFixedArray $hardness
return SplFixedArray

$id protected property

protected $id

$light public static property

public static SplFixedArray $light
return SplFixedArray

$lightFilter public static property

public static SplFixedArray $lightFilter
return SplFixedArray

$list public static property

public static SplFixedArray $list
return SplFixedArray

$meta protected property

protected $meta

$solid public static property

public static SplFixedArray $solid
return SplFixedArray

$transparent public static property

public static SplFixedArray $transparent
return SplFixedArray