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
|
|
|
|
|
|
|
|
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",
|
2023-09-01 15:00:50 +02:00
|
|
|
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2, pickaxey=1, handy=1},
|
2024-02-27 00:44:40 +01:00
|
|
|
is_ground_content = false,
|
2023-09-01 15:00:50 +02:00
|
|
|
_mcl_hardness=0.8,
|
2015-01-31 00:06:27 +01:00
|
|
|
legacy_facedir_simple = true,
|
2022-03-15 02:39:58 +01:00
|
|
|
_sound_def = {
|
2024-02-27 00:44:40 +01:00
|
|
|
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"
|