isUnbreakable()){ return true; } if($object instanceof Block){ if( $object->getToolType() === Tool::TYPE_PICKAXE and $this->isPickaxe() or $object->getToolType() === Tool::TYPE_SHOVEL and $this->isShovel() or $object->getToolType() === Tool::TYPE_AXE and $this->isAxe() or $object->getToolType() === Tool::TYPE_SWORD and $this->isSword() or $object->getToolType() === Tool::TYPE_SHEARS and $this->isShears() ){ $this->applyDamage(1); }elseif(!$this->isShears() and $object->getBreakTime($this) > 0){ $this->applyDamage(2); } }elseif($this->isHoe()){ if(($object instanceof Block) and ($object->getId() === self::GRASS or $object->getId() === self::DIRT)){ $this->applyDamage(1); } }elseif(($object instanceof Entity) and !$this->isSword()){ $this->applyDamage(2); }else{ $this->applyDamage(1); } return true; } public function isTool(){ return true; } }