PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
Public Member Functions | |
__construct (private float $hardness, private int $toolType=BlockToolType::NONE, private int $toolHarvestLevel=0, ?float $blastResistance=null) | |
breaksInstantly () | |
getBlastResistance () | |
getBreakTime (Item $item) | |
getHardness () | |
getToolHarvestLevel () | |
getToolType () | |
isBreakable () | |
isToolCompatible (Item $tool) | |
Static Public Member Functions | |
static | axe (float $hardness, ?ToolTier $toolTier=null, ?float $blastResistance=null) |
static | indestructible (float $blastResistance=18000000.0) |
static | instant (int $toolType=BlockToolType::NONE, int $toolHarvestLevel=0) |
static | pickaxe (float $hardness, ?ToolTier $toolTier=null, ?float $blastResistance=null) |
static | shovel (float $hardness, ?ToolTier $toolTier=null, ?float $blastResistance=null) |
static | tier (float $hardness, int $toolType, ToolTier $toolTier, ?float $blastResistance=null) |
Public Attributes | |
const | COMPATIBLE_TOOL_MULTIPLIER = 1.5 |
const | INCOMPATIBLE_TOOL_MULTIPLIER = 5.0 |
Definition at line 30 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::__construct | ( | private float | $hardness, |
private int | $toolType = BlockToolType::NONE, | ||
private int | $toolHarvestLevel = 0, | ||
?float | $blastResistance = null ) |
float | null | $blastResistance | default 5x hardness |
Definition at line 47 of file BlockBreakInfo.php.
|
static |
Definition at line 68 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::breaksInstantly | ( | ) |
Returns whether this block can be instantly broken.
Definition at line 97 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::getBlastResistance | ( | ) |
Returns the block's resistance to explosions. Usually 5x hardness.
Definition at line 104 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::getBreakTime | ( | Item | $item | ) |
Returns the seconds that this block takes to be broken using an specific Item
InvalidArgumentException if the item efficiency is not a positive number
Definition at line 147 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::getHardness | ( | ) |
Returns a base value used to compute block break times.
Definition at line 83 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::getToolHarvestLevel | ( | ) |
Returns the level of tool required to harvest the block (for normal blocks). When the tool type matches the block's required tool type, the tool must have a harvest level greater than or equal to this value to be able to successfully harvest the block.
If the block requires a specific minimum tier of tiered tool, the minimum tier required should be returned. Otherwise, 1 should be returned if a tool is required, 0 if not.
Definition at line 122 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::getToolType | ( | ) |
Definition at line 108 of file BlockBreakInfo.php.
|
static |
Definition at line 76 of file BlockBreakInfo.php.
|
static |
Definition at line 72 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::isBreakable | ( | ) |
Returns whether the block can be broken at all.
Definition at line 90 of file BlockBreakInfo.php.
pocketmine\block\BlockBreakInfo::isToolCompatible | ( | Item | $tool | ) |
Returns whether the specified item is the proper tool to use for breaking this block. This checks tool type and harvest level requirement.
In most cases this is also used to determine whether block drops should be created or not, except in some special cases such as vines.
Definition at line 133 of file BlockBreakInfo.php.
|
static |
Definition at line 60 of file BlockBreakInfo.php.
|
static |
Definition at line 64 of file BlockBreakInfo.php.
|
static |
Definition at line 56 of file BlockBreakInfo.php.
const pocketmine\block\BlockBreakInfo::COMPATIBLE_TOOL_MULTIPLIER = 1.5 |
If the tool is the correct type and high enough harvest level (tool tier), base break time is hardness multiplied by this value.
Definition at line 35 of file BlockBreakInfo.php.
const pocketmine\block\BlockBreakInfo::INCOMPATIBLE_TOOL_MULTIPLIER = 5.0 |
If the tool is an incorrect type or too low harvest level (tool tier), base break time is hardness multiplied by this value.
Definition at line 40 of file BlockBreakInfo.php.