mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Change block tool types to bitflags
This allows specification of multiple tool types for a block, such as cobwebs.
This commit is contained in:
@ -224,12 +224,8 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
if($this->canBeBrokenWith($item)){
|
||||
if($this->getToolType() === BlockToolType::TYPE_SHEARS and $item->isShears()){
|
||||
$base /= 15;
|
||||
}elseif(
|
||||
($this->getToolType() === BlockToolType::TYPE_PICKAXE and ($tier = $item->isPickaxe()) !== false) or
|
||||
($this->getToolType() === BlockToolType::TYPE_AXE and ($tier = $item->isAxe()) !== false) or
|
||||
($this->getToolType() === BlockToolType::TYPE_SHOVEL and ($tier = $item->isShovel()) !== false)
|
||||
){
|
||||
switch($tier){
|
||||
}elseif($item instanceof TieredTool and ($this->getToolType() & $item->getBlockToolType()) !== 0){
|
||||
switch($item->getTier()){
|
||||
case TieredTool::TIER_WOODEN:
|
||||
$base /= 2;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user