z_mirror/BlueprintTools
git clone https://git.raiguard.me/z_mirror/BlueprintTools
db88a13
clipboards
1local util ={} 2 3-- get blueprint from cursor stack (if there is one) 4function util . get_blueprint ( item_stack ) 5if not ( item_stack and item_stack . valid_for_read ) then return end 6if item_stack . is_blueprint then 7return item_stack 8elseif item_stack . is_blueprint_book and item_stack . active_index then 9local inventory =item_stack . get_inventory ( defines . inventory . item_main ) 10if inventory . is_empty () then return end 11return util . get_blueprint ( inventory [ item_stack . active_index ]) 12end 13end 14 15return util