1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2024-11-15 23:10:33 +01:00
pipeworks/tubes/embedded_tube.lua
Luke aka SwissalpS c7b153f1ef
Is ground content (#110)
* trashcan isn't ground content

* pipes aren't ground content

* auto tree tap isn't ground content

* filter-injectors aren't ground content

* devices aren't ground content

also some whitespace indentation fixes

* is_ground_content

* autocrafter isn't ground content

* tubes aren't ground content

* pane_embedded_tube isn't ground content

* embedded_tube isn't ground content

* routing tubes aren't ground content

* whitespace fix indentation
2024-02-26 18:44:40 -05:00

70 lines
2.0 KiB
Lua

local materials = ...
local S = minetest.get_translator("pipeworks")
local straight = function(pos, node, velocity, stack) return {velocity} end
local steel_tex = "[combine:16x16^[noalpha^[colorize:#D3D3D3"
if minetest.get_modpath("default") then steel_tex = "default_steel_block.png" end
-- register an embedded tube
function pipeworks.register_embedded_tube(nodename, opts)
minetest.register_node(nodename, {
description = opts.description,
tiles = {
opts.base_texture,
opts.base_texture,
opts.base_texture,
opts.base_texture,
opts.base_texture .. "^pipeworks_tube_connection_metallic.png",
opts.base_texture .. "^pipeworks_tube_connection_metallic.png",
},
paramtype = "light",
paramtype2 = "facedir",
groups = {
cracky = 1,
oddly_breakable_by_hand = 1,
tubedevice = 1,
dig_glass = 2,
pickaxey=1,
handy=1
},
is_ground_content = false,
_mcl_hardness = 0.8,
legacy_facedir_simple = true,
_sound_def = {
key = "node_sound_stone_defaults",
},
tube = {
connect_sides = {
front = 1,
back = 1
},
priority = 50,
can_go = straight,
can_insert = function(pos, node, stack, direction)
local dir = minetest.facedir_to_dir(node.param2)
return vector.equals(dir, direction) or vector.equals(vector.multiply(dir, -1), direction)
end
},
after_place_node = pipeworks.after_place,
after_dig_node = pipeworks.after_dig,
on_rotate = pipeworks.on_rotate,
})
minetest.register_craft( {
output = nodename .. " 1",
recipe = {
{ opts.base_ingredient, opts.base_ingredient, opts.base_ingredient },
{ opts.base_ingredient, "pipeworks:tube_1", opts.base_ingredient },
{ opts.base_ingredient, opts.base_ingredient, opts.base_ingredient }
},
})
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = nodename
end
-- steelblock embedded tube
pipeworks.register_embedded_tube("pipeworks:steel_block_embedded_tube", {
description = S("Airtight steelblock embedded tube"),
base_texture = steel_tex,
base_ingredient = materials.steel_ingot
})