-- Crafting recipes for pneumatic tubes -- This function was adapted from Hades Revisited and is licensed as: -- GNU LGPLv2.1 local function facedir_to_right_dir (facedir) -- find the other directions local backdir = minetest.facedir_to_dir (facedir) local topdir = ({[0]={x=0, y=1, z=0}, {x=0 , y=0 , z=1 } , {x=0 , y=0 , z=-1 } , {x=1 , y=0 , z=0 } , {x=-1 , y=0 , z=0 } , {x=0 , y=-1 , z=0}})[math.floor(facedir/4)] -- return a cross product return { x=topdir.y*backdir.z - backdir.y*topdir.z , y=topdir.z*backdir.x - backdir.z*topdir.x , z=topdir.x*backdir.y - backdir.x*topdir.y } end -- If homedecor is not installed, we need to register its crafting chain for -- plastic sheeting so that pipeworks remains compatible with it. --if minetest.get_modpath("homedecor") == nil then minetest.register_craftitem(":homedecor:oil_extract", { description = "Oil extract", inventory_image = "homedecor_oil_extract.png", }) minetest.register_craftitem(":homedecor:paraffin", { description = "Unprocessed paraffin", inventory_image = "homedecor_paraffin.png", }) minetest.register_alias("homedecor:plastic_base", "homedecor:paraffin") minetest.register_craftitem(":homedecor:plastic_sheeting", { description = "Plastic sheet", inventory_image = "homedecor_plastic_sheeting.png", }) minetest.register_craft({ type = "shapeless", output = "homedecor:oil_extract 4", recipe = { "group:leaves", "group:leaves", "group:leaves", "group:leaves", "group:leaves", "group:leaves" } }) minetest.register_craft({ type = "cooking", output = "homedecor:paraffin", recipe = "homedecor:oil_extract", }) minetest.register_craft({ type = "cooking", output = "homedecor:plastic_sheeting", recipe = "homedecor:paraffin", }) -- 220429 RJK: Modify to use local version of a missing API function if pipeworks ~= nil and pipeworks.enable_one_way_tube then minetest.register_node("technic:one_way_tube", { description = "One way tube", tiles = {"pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_output.png", "pipeworks_one_way_tube_input.png", "pipeworks_one_way_tube_side.png", "pipeworks_one_way_tube_top.png"}, paramtype2 = "facedir", drawtype = "nodebox", paramtype = "light", node_box = {type = "fixed", fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1}, sounds = default.node_sound_wood_defaults(), tube = { connect_sides = {left = 1, right = 1}, can_go = function(pos, node, velocity, stack) return {velocity} end, can_insert = function(pos, node, stack, direction) local dir = facedir_to_right_dir (node.param2) return vector.equals(dir, direction) end, priority = 75 -- Higher than normal tubes, but lower than receivers }, -- after_place_node = pipeworks.after_place, -- after_dig_node = pipeworks.after_dig, }) minetest.register_craft({ output = "technic:one_way_tube 2", recipe = { { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, { "group:stick", "default:mese_crystal", "homedecor:plastic_sheeting" }, { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } }, }) end -- ############## minetest.register_craft({ type = "cooking", output = "technic:wire_00000000_off 2", recipe = "default:mese_crystal_fragment", cooktime = 3, }) minetest.register_craft({ type = "cooking", output = "technic:wire_00000000_off 18", recipe = "default:mese_crystal", cooktime = 15, }) minetest.register_craft({ type = "cooking", output = "technic:wire_00000000_off 162", recipe = "default:mese", cooktime = 30, }) -- Glue and fiber minetest.register_craftitem("technic:glue", { image = "mesecons_glue.png", on_place_on_ground = minetest.craftitem_place_item, description="Glue", }) minetest.register_craftitem("technic:fiber", { image = "mesecons_fiber.png", on_place_on_ground = minetest.craftitem_place_item, description="Fiber", }) minetest.register_craft({ output = "technic:glue 2", type = "cooking", recipe = "group:sapling", cooktime = 2 }) minetest.register_craft({ output = "technic:fiber 6", type = "cooking", recipe = "technic:glue", cooktime = 4 }) -- Normal (non-sticky) Pistons: -- offstate minetest.register_node("technic:piston_normal_off", { description = "Piston", tiles = { "mesecons_piston_top.png", "mesecons_piston_bottom.png", "mesecons_piston_left.png", "mesecons_piston_right.png", "mesecons_piston_back.png", "mesecons_piston_pusher_front.png" }, groups = {cracky = 3}, paramtype2 = "facedir", is_ground_content = false, -- after_place_node = piston_orientate, sounds = default.node_sound_wood_defaults(), -- on_rotate = piston_rotate, }) minetest.register_node("technic:piston_sticky_off", { description = "Sticky Piston", tiles = { "mesecons_piston_top.png", "mesecons_piston_bottom.png", "mesecons_piston_left.png", "mesecons_piston_right.png", "mesecons_piston_back.png", "mesecons_piston_pusher_front_sticky.png" }, groups = {cracky = 3}, paramtype2 = "facedir", is_ground_content = false, -- after_place_node = piston_orientate, sounds = default.node_sound_wood_defaults(), -- on_rotate = piston_rotate, }) --craft recipes minetest.register_craft({ output = "technic:piston_normal_off 2", recipe = { { "group:wood" , "group:wood" , "group:wood" , } , { "default:cobble" , "default:steel_ingot" , "default:cobble" , } , { "default:cobble" , "default:mese_crystal_fragment" , "default:cobble" , } , } }) minetest.register_craft({ output = "technic:piston_sticky_off", recipe = { {"technic:glue"}, {"technic:piston_normal_off"}, } })