PHP Class pocketmine\block\Block

Inheritance: extends pocketmine\level\Position, implements pocketmine\metadata\Metadatable
Afficher le fichier Open project: iTXTech/Genisys Class Usage Examples

Méthodes publiques

Свойство Type Description
$boundingBox pocketmine\math\AxisAlignedBB
$fullList SplFixedArray
$hardness SplFixedArray
$light SplFixedArray
$lightFilter SplFixedArray
$list SplFixedArray
$solid SplFixedArray
$transparent SplFixedArray

Protected Properties

Свойство Type Description
$id
$meta

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
recalculateBoundingBox ( ) : AxisAlignedBB

Method Details

__construct() public méthode

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

__toString() public méthode

public __toString ( ) : string
Résultat string

activate() public méthode

public activate ( )

addVelocityToEntity() public méthode

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

calculateIntercept() public méthode

public calculateIntercept ( Vector3 $pos1, Vector3 $pos2 ) : MovingObjectPosition
$pos1 pocketmine\math\Vector3
$pos2 pocketmine\math\Vector3
Résultat pocketmine\level\MovingObjectPosition

canBeActivated() public méthode

AKA: Block->isActivable
public canBeActivated ( ) : boolean
Résultat boolean

canBeBrokenWith() public méthode

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

canBeFlowedInto() public méthode

AKA: Block->isFlowable
public canBeFlowedInto ( ) : boolean
Résultat boolean

canBePlaced() public méthode

AKA: Block->isPlaceable
public canBePlaced ( ) : boolean
Résultat boolean

canBeReplaced() public méthode

AKA: Block->canBeReplaced()
public canBeReplaced ( ) : boolean
Résultat boolean

canNeighborBurn() public méthode

public canNeighborBurn ( )

canPassThrough() public méthode

public canPassThrough ( )

collidesWithBB() public méthode

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

deactivate() public méthode

public deactivate ( )

get() public static méthode

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

getBoundingBox() public méthode

public getBoundingBox ( ) : AxisAlignedBB
Résultat pocketmine\math\AxisAlignedBB

getBreakTime() public méthode

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

getBurnAbility() public méthode

public getBurnAbility ( ) : integer
Résultat integer

getBurnChance() public méthode

public getBurnChance ( ) : integer
Résultat integer

getDamage() final public méthode

final public getDamage ( ) : integer
Résultat integer

getDrops() public méthode

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

getFrictionFactor() public méthode

public getFrictionFactor ( ) : float
Résultat float

getHardness() public méthode

public getHardness ( ) : integer
Résultat integer

getId() final public méthode

final public getId ( ) : integer
Résultat integer

getLightLevel() public méthode

public getLightLevel ( ) : integer
Résultat integer 0-15

getMetadata() public méthode

public getMetadata ( $metadataKey )

getName() public méthode

public getName ( ) : string
Résultat string

getResistance() public méthode

public getResistance ( ) : integer
Résultat integer

getSide() public méthode

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

getToolType() public méthode

public getToolType ( ) : integer
Résultat integer

hasEntityCollision() public méthode

public hasEntityCollision ( )

hasMetadata() public méthode

public hasMetadata ( $metadataKey )

init() public static méthode

public static init ( )

isActivated() public méthode

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

isBreakable() public méthode

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

isPlaceable() public méthode

public isPlaceable ( )

isSolid() public méthode

public isSolid ( )

isTopFacingSurfaceSolid() public méthode

isTransparent() public méthode

public isTransparent ( ) : boolean
Résultat boolean

onActivate() public méthode

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
Résultat boolean

onBreak() public méthode

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

onEntityCollide() public méthode

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

onUpdate() public méthode

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

place() public méthode

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
Résultat boolean

position() final public méthode

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

recalculateBoundingBox() protected méthode

protected recalculateBoundingBox ( ) : AxisAlignedBB
Résultat pocketmine\math\AxisAlignedBB

removeMetadata() public méthode

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

setDamage() final public méthode

final public setDamage ( integer $meta )
$meta integer

setMetadata() public méthode

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

tickRate() public méthode

public tickRate ( ) : integer
Résultat integer

Property Details

$boundingBox public_oe property

public AxisAlignedBB,pocketmine\math $boundingBox
Résultat pocketmine\math\AxisAlignedBB

$fullList public_oe static_oe property

public static SplFixedArray $fullList
Résultat SplFixedArray

$hardness public_oe static_oe property

public static SplFixedArray $hardness
Résultat SplFixedArray

$id protected_oe property

protected $id

$light public_oe static_oe property

public static SplFixedArray $light
Résultat SplFixedArray

$lightFilter public_oe static_oe property

public static SplFixedArray $lightFilter
Résultat SplFixedArray

$list public_oe static_oe property

public static SplFixedArray $list
Résultat SplFixedArray

$meta protected_oe property

protected $meta

$solid public_oe static_oe property

public static SplFixedArray $solid
Résultat SplFixedArray

$transparent public_oe static_oe property

public static SplFixedArray $transparent
Résultat SplFixedArray