SurvivalBlockBreakHandler
in package
Table of Contents
- DEFAULT_FX_INTERVAL_TICKS = 5
- $block : Block
- $blockPos : Vector3
- $breakProgress : float
- $breakSpeed : float
- $fxTicker : int
- $fxTickInterval : int
- $maxPlayerDistance : int
- $player : Player
- $targetedFace : int
- __construct() : mixed
- __destruct() : mixed
- getBlockPos() : Vector3
- getBreakProgress() : float
- getBreakSpeed() : float
- getTargetedFace() : int
- setTargetedFace() : void
- update() : bool
- calculateBreakProgressPerTick() : float
- Returns the calculated break speed as percentage progress per game tick.
Constants
DEFAULT_FX_INTERVAL_TICKS
public
mixed
DEFAULT_FX_INTERVAL_TICKS
= 5
Properties
$block
private
Block
$block
$blockPos
private
Vector3
$blockPos
$breakProgress
private
float
$breakProgress
= 0
$breakSpeed
private
float
$breakSpeed
$fxTicker
private
int
$fxTicker
= 0
$fxTickInterval
private
int
$fxTickInterval
$maxPlayerDistance
private
int
$maxPlayerDistance
$player
private
Player
$player
$targetedFace
private
int
$targetedFace
Methods
__construct()
public
__construct(Player $player, Vector3 $blockPos, Block $block, int $targetedFace, int $maxPlayerDistance[, int $fxTickInterval = self::DEFAULT_FX_INTERVAL_TICKS ]) : mixed
Parameters
- $player : Player
- $blockPos : Vector3
- $block : Block
- $targetedFace : int
- $maxPlayerDistance : int
- $fxTickInterval : int = self::DEFAULT_FX_INTERVAL_TICKS
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —getBlockPos()
public
getBlockPos() : Vector3
Return values
Vector3 —getBreakProgress()
public
getBreakProgress() : float
Return values
float —getBreakSpeed()
public
getBreakSpeed() : float
Return values
float —getTargetedFace()
public
getTargetedFace() : int
Return values
int —setTargetedFace()
public
setTargetedFace(int $face) : void
Parameters
- $face : int
Return values
void —update()
public
update() : bool
Return values
bool —calculateBreakProgressPerTick()
Returns the calculated break speed as percentage progress per game tick.
private
calculateBreakProgressPerTick() : float