|
PocketMine-MP 5.39.3 git-66148f13a91e4af6778ba9f200ca25ad8a04a584
|
Collaboration diagram for pocketmine\block\BlockBreakInfo:Public Member Functions | |
| __construct (private float $hardness, private int $toolType=BlockToolType::NONE, private int $toolHarvestLevel=0, ?float $blastResistance=null, ?bool $explosionHarvestable=null,) | |
| breaksInstantly () | |
| getBlastResistance () | |
| getBreakTime (Item $item) | |
| getHardness () | |
| getToolHarvestLevel () | |
| getToolType () | |
| isBreakable () | |
| isExplosionHarvestable () | |
| isToolCompatible (Item $tool) | |
Static Public Member Functions | |
| static | axe (float $hardness, ?ToolTier $toolTier=null, ?float $blastResistance=null) |
| static | indestructible (float $blastResistance=18000003.75) |
| 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, | ||
| ?bool | $explosionHarvestable = null ) |
| float | null | $blastResistance | default 5x hardness |
| bool | null | $explosionHarvestable | Whether explosions are considered a compatible "tool" to harvest. Defaults to true if a pickaxe is compatible |
Definition at line 49 of file BlockBreakInfo.php.
|
static |
Definition at line 72 of file BlockBreakInfo.php.
| pocketmine\block\BlockBreakInfo::breaksInstantly | ( | ) |
Returns whether this block can be instantly broken.
Definition at line 101 of file BlockBreakInfo.php.
| pocketmine\block\BlockBreakInfo::getBlastResistance | ( | ) |
Returns the block's resistance to explosions. Usually 5x hardness.
Definition at line 108 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 151 of file BlockBreakInfo.php.
| pocketmine\block\BlockBreakInfo::getHardness | ( | ) |
Returns a base value used to compute block break times.
Definition at line 87 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 126 of file BlockBreakInfo.php.
| pocketmine\block\BlockBreakInfo::getToolType | ( | ) |
Definition at line 112 of file BlockBreakInfo.php.
|
static |
Definition at line 80 of file BlockBreakInfo.php.
|
static |
Definition at line 76 of file BlockBreakInfo.php.
| pocketmine\block\BlockBreakInfo::isBreakable | ( | ) |
Returns whether the block can be broken at all.
Definition at line 94 of file BlockBreakInfo.php.
| pocketmine\block\BlockBreakInfo::isExplosionHarvestable | ( | ) |
Returns whether an explosion can harvest resources from the block, as if a compatible tool was used. If this returns true, required harvest level and tool type will be ignored when calculating drops for explosions. Otherwise, the block will behave as if it was broken with an empty hand.
Note: If the required harvest level is 0, this has no effect.
Definition at line 176 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 137 of file BlockBreakInfo.php.
|
static |
Definition at line 64 of file BlockBreakInfo.php.
|
static |
Definition at line 68 of file BlockBreakInfo.php.
|
static |
Definition at line 60 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.