2020-02-18 18:34:52 +01:00
|
|
|
local S = minetest.get_translator("pipeworks")
|
|
|
|
|
2015-01-31 00:06:27 +01:00
|
|
|
local straight = function(pos, node, velocity, stack) return {velocity} end
|
2022-03-15 02:39:58 +01:00
|
|
|
local steel_tex = "[combine:16x16^[noalpha^[colorize:#D3D3D3"
|
|
|
|
if minetest.get_modpath("default") then steel_tex = "default_steel_block.png" end
|
2015-01-31 00:06:27 +01:00
|
|
|
|
|
|
|
minetest.register_node("pipeworks:steel_block_embedded_tube", {
|
2020-02-18 18:34:52 +01:00
|
|
|
description = S("Airtight steelblock embedded tube"),
|
2015-01-31 00:06:27 +01:00
|
|
|
tiles = {
|
2022-03-15 02:39:58 +01:00
|
|
|
steel_tex, steel_tex,
|
|
|
|
steel_tex, steel_tex,
|
|
|
|
steel_tex .. "^pipeworks_tube_connection_metallic.png",
|
|
|
|
steel_tex .. "^pipeworks_tube_connection_metallic.png",
|
2015-01-31 00:06:27 +01:00
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
2022-12-02 21:54:21 +01:00
|
|
|
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2, pickaxey=5},
|
|
|
|
_mcl_hardness=1.6,
|
2015-01-31 00:06:27 +01:00
|
|
|
legacy_facedir_simple = true,
|
2022-03-15 02:39:58 +01:00
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2015-01-31 00:06:27 +01:00
|
|
|
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,
|
|
|
|
},
|
2015-02-07 08:45:17 +01:00
|
|
|
after_place_node = pipeworks.after_place,
|
|
|
|
after_dig_node = pipeworks.after_dig,
|
2018-09-15 16:30:13 +02:00
|
|
|
on_rotate = pipeworks.on_rotate,
|
2015-01-31 00:06:27 +01:00
|
|
|
})
|
2021-04-02 21:48:28 +02:00
|
|
|
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:steel_block_embedded_tube"
|
2015-01-31 00:06:27 +01:00
|
|
|
|
|
|
|
local pane_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -9/64, -9/64, -8/16, 9/64, 9/64, 8/16 }, -- tube
|
|
|
|
{ -8/16, -8/16, -1/16, 8/16, 8/16, 1/16 } -- pane
|
|
|
|
}
|
|
|
|
}
|
2021-03-24 19:47:25 +01:00
|
|
|
|
|
|
|
local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes
|
|
|
|
and "clip" or true
|
|
|
|
|
2015-01-31 00:06:27 +01:00
|
|
|
minetest.register_node("pipeworks:steel_pane_embedded_tube", {
|
|
|
|
drawtype = "nodebox",
|
2020-02-18 18:34:52 +01:00
|
|
|
description = S("Airtight panel embedded tube"),
|
2015-01-31 00:06:27 +01:00
|
|
|
tiles = {
|
2022-05-12 00:41:28 +02:00
|
|
|
pipeworks.make_tube_tile("pipeworks_pane_embedded_tube_sides.png^[transformR90"),
|
|
|
|
pipeworks.make_tube_tile("pipeworks_pane_embedded_tube_sides.png^[transformR90"),
|
|
|
|
pipeworks.make_tube_tile("pipeworks_pane_embedded_tube_sides.png"),
|
|
|
|
pipeworks.make_tube_tile("pipeworks_pane_embedded_tube_sides.png"),
|
|
|
|
pipeworks.make_tube_tile("pipeworks_pane_embedded_tube_ends.png"),
|
|
|
|
pipeworks.make_tube_tile("pipeworks_pane_embedded_tube_ends.png"),
|
|
|
|
},
|
2021-03-24 19:47:25 +01:00
|
|
|
use_texture_alpha = texture_alpha_mode,
|
2015-01-31 00:06:27 +01:00
|
|
|
node_box = pane_box,
|
|
|
|
selection_box = pane_box,
|
|
|
|
collision_box = pane_box,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
2022-12-02 21:54:21 +01:00
|
|
|
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2, pickaxey=5},
|
|
|
|
_mcl_hardness=1.6,
|
2015-01-31 00:06:27 +01:00
|
|
|
legacy_facedir_simple = true,
|
2022-03-15 02:39:58 +01:00
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2015-01-31 00:06:27 +01:00
|
|
|
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,
|
|
|
|
},
|
2015-02-07 08:45:17 +01:00
|
|
|
after_place_node = pipeworks.after_place,
|
|
|
|
after_dig_node = pipeworks.after_dig,
|
2018-09-15 16:30:13 +02:00
|
|
|
on_rotate = pipeworks.on_rotate,
|
2015-01-31 00:06:27 +01:00
|
|
|
})
|
2021-04-02 21:48:28 +02:00
|
|
|
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:steel_pane_embedded_tube"
|