2020-03-17 23:43:30 +03:00
|
|
|
--[[
|
|
|
|
|
|
|
|
TechAge
|
|
|
|
=======
|
|
|
|
|
|
|
|
Copyright (C) 2020 Joachim Stolberg
|
|
|
|
|
2020-10-19 20:09:17 +03:00
|
|
|
AGPL v3
|
2020-03-17 23:43:30 +03:00
|
|
|
See LICENSE.txt for more information
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-03-17 23:43:30 +03:00
|
|
|
Tubes in TA4 design based on tubelib2
|
|
|
|
|
|
|
|
]]--
|
|
|
|
|
2020-03-19 00:35:23 +03:00
|
|
|
local Tube = techage.Tube
|
2021-05-13 18:52:07 +03:00
|
|
|
local S = techage.S
|
2020-03-17 23:43:30 +03:00
|
|
|
|
|
|
|
minetest.register_node("techage:ta4_tubeS", {
|
2021-05-13 18:52:07 +03:00
|
|
|
description = S("TA4 Tube"),
|
2020-03-17 23:43:30 +03:00
|
|
|
tiles = { -- Top, base, right, left, front, back
|
|
|
|
"techage_tubeta4_tube.png^[transformR90",
|
|
|
|
"techage_tubeta4_tube.png^[transformR90",
|
|
|
|
"techage_tubeta4_tube.png",
|
|
|
|
"techage_tubeta4_tube.png",
|
|
|
|
"techage_tube_hole.png",
|
|
|
|
"techage_tube_hole.png",
|
|
|
|
},
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-03-17 23:43:30 +03:00
|
|
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
|
|
|
if not Tube:after_place_tube(pos, placer, pointed_thing) then
|
|
|
|
minetest.remove_node(pos)
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-03-17 23:43:30 +03:00
|
|
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|
|
|
Tube:after_dig_tube(pos, oldnode, oldmetadata)
|
|
|
|
end,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-03-17 23:43:30 +03:00
|
|
|
paramtype2 = "facedir",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-2/8, -2/8, -4/8, 2/8, 2/8, 4/8},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -1/4, -1/4, -1/2, 1/4, 1/4, 1/2 },
|
|
|
|
},
|
|
|
|
collision_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -1/4, -1/4, -1/2, 1/4, 1/4, 1/2 },
|
|
|
|
},
|
|
|
|
on_rotate = screwdriver.disallow,
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2020-03-17 23:43:30 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
is_ground_content = false,
|
2020-09-04 14:57:16 +03:00
|
|
|
groups = {choppy=2, cracky=3},
|
2020-03-17 23:43:30 +03:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("techage:ta4_tubeA", {
|
2021-05-13 18:52:07 +03:00
|
|
|
description = S("TA4 Tube"),
|
2020-03-17 23:43:30 +03:00
|
|
|
tiles = { -- Top, base, right, left, front, back
|
|
|
|
"techage_tubeta4_knee2.png",
|
|
|
|
"techage_tubeta4_hole2.png^[transformR180",
|
|
|
|
"techage_tubeta4_knee.png^[transformR270",
|
|
|
|
"techage_tubeta4_knee.png",
|
|
|
|
"techage_tubeta4_knee2.png",
|
|
|
|
"techage_tubeta4_hole2.png",
|
|
|
|
},
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-03-17 23:43:30 +03:00
|
|
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|
|
|
Tube:after_dig_tube(pos, oldnode, oldmetadata)
|
|
|
|
end,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-03-17 23:43:30 +03:00
|
|
|
paramtype2 = "facedir",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-2/8, -4/8, -2/8, 2/8, 2/8, 2/8},
|
|
|
|
{-2/8, -2/8, -4/8, 2/8, 2/8, -2/8},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -1/4, -1/2, -1/2, 1/4, 1/4, 1/4 },
|
|
|
|
},
|
|
|
|
collision_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -1/4, -1/2, -1/2, 1/4, 1/4, 1/4 },
|
|
|
|
},
|
|
|
|
on_rotate = screwdriver.disallow,
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2020-03-17 23:43:30 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
is_ground_content = false,
|
2020-09-04 14:57:16 +03:00
|
|
|
groups = {choppy=2, cracky=3, not_in_creative_inventory=1},
|
2020-03-17 23:43:30 +03:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2020-03-27 21:44:19 +03:00
|
|
|
drop = "techage:ta4_tubeS",
|
2020-03-17 23:43:30 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "techage:ta4_tubeS 6",
|
|
|
|
recipe = {
|
|
|
|
{"dye:blue", "", "basic_materials:plastic_sheet"},
|
|
|
|
{"", "basic_materials:plastic_sheet", ""},
|
|
|
|
{"basic_materials:plastic_sheet", "", "techage:aluminum"},
|
|
|
|
},
|
|
|
|
})
|
2020-05-31 21:41:17 +03:00
|
|
|
|
|
|
|
techage.TA4tubes = {
|
|
|
|
["techage:ta4_tubeS"] = true,
|
|
|
|
["techage:ta4_tubeA"] = true,
|
2022-01-04 21:40:27 +03:00
|
|
|
}
|