2020-02-18 20:34:52 +03:00
|
|
|
local S = minetest.get_translator("pipeworks")
|
|
|
|
|
2015-01-31 02:06:27 +03:00
|
|
|
local straight = function(pos, node, velocity, stack) return {velocity} end
|
|
|
|
|
|
|
|
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 21:47:25 +03:00
|
|
|
|
|
|
|
local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes
|
|
|
|
and "clip" or true
|
|
|
|
|
2015-01-31 02:06:27 +03:00
|
|
|
minetest.register_node("pipeworks:steel_pane_embedded_tube", {
|
|
|
|
drawtype = "nodebox",
|
2020-02-18 20:34:52 +03:00
|
|
|
description = S("Airtight panel embedded tube"),
|
2015-01-31 02:06:27 +03:00
|
|
|
tiles = {
|
2022-05-12 01:41:28 +03: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 21:47:25 +03:00
|
|
|
use_texture_alpha = texture_alpha_mode,
|
2015-01-31 02:06:27 +03:00
|
|
|
node_box = pane_box,
|
|
|
|
selection_box = pane_box,
|
|
|
|
collision_box = pane_box,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
2023-09-01 16:00:50 +03:00
|
|
|
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2, pickaxey=1, handy=1},
|
2024-02-27 02:44:40 +03:00
|
|
|
is_ground_content = false,
|
2023-09-01 16:00:50 +03:00
|
|
|
_mcl_hardness=0.8,
|
2015-01-31 02:06:27 +03:00
|
|
|
legacy_facedir_simple = true,
|
2022-03-15 04:39:58 +03:00
|
|
|
_sound_def = {
|
2024-02-27 02:44:40 +03:00
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2015-01-31 02:06:27 +03: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 10:45:17 +03:00
|
|
|
after_place_node = pipeworks.after_place,
|
|
|
|
after_dig_node = pipeworks.after_dig,
|
2018-09-15 17:30:13 +03:00
|
|
|
on_rotate = pipeworks.on_rotate,
|
2015-01-31 02:06:27 +03:00
|
|
|
})
|
2021-04-02 22:48:28 +03:00
|
|
|
pipeworks.ui_cat_tube_list[#pipeworks.ui_cat_tube_list+1] = "pipeworks:steel_pane_embedded_tube"
|