123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- local slope_cbox_long = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -1.5, 0.5, -0.375, 0.5},
- {-0.5, -0.375, -1.25, 0.5, -0.25, 0.5},
- {-0.5, -0.25, -1, 0.5, -0.125, 0.5},
- {-0.5, -0.125, -0.75, 0.5, 0, 0.5},
- {-0.5, 0, -0.5, 0.5, 0.125, 0.5},
- {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5},
- {-0.5, 0.25, 0, 0.5, 0.375, 0.5},
- {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5},
- }
- }
- local icorner_cbox_long = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -1.5, -0.25, 0.5, 0.5},
- {-0.5, -0.5, 0.25, 1.5, 0.5, 0.5},
- {-0.5, -0.5, 0, 1.5, 0.375, 0.5},
- {-0.5, -0.5, -1.5, 0, 0.375, 0.5},
- {-0.5, -0.5, -1.5, 0.25, 0.25, 0.5},
- {-0.5, -0.5, -1.5, 0.5, 0.125, 0.5},
- {-0.5, -0.5, -1.5, 0.75, 0, 0.5},
- {-0.5, -0.5, -1.5, 1, -0.125, 0.5},
- {-0.5, -0.5, -1.5, 1.25, -0.25, 0.5},
- {-0.5, -0.5, -1.5, 1.5, -0.375, 0.5},
- {-0.5, -0.5, -0.25, 1.5, 0.25, 0.5},
- {-0.5, -0.5, -0.5, 1.5, 0.125, 0.5},
- {-0.5, -0.5, -0.75, 1.5, 0, 0.5},
- {-0.5, -0.5, -1, 1.5, -0.125, 0.5},
- {-0.5, -0.5, -1.25, 1.5, -0.25, 0.5},
- }
- }
- local ocorner_cbox_long = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, 0.25, -0.25, 0.5, 0.5},
- {-0.5, -0.5, 0, 0, 0.375, 0.5},
- {-0.5, -0.5, -0.25, 0.25, 0.25, 0.5},
- {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
- {-0.5, -0.5, -0.75, 0.75, 0, 0.5},
- {-0.5, -0.5, -1, 1, -0.125, 0.5},
- {-0.5, -0.5, -1.25, 1.25, -0.25, 0.5},
- {-0.5, -0.5, -1.5, 1.5, -0.375, 0.5},
- }
- }
- local wood_long_slopes = { --Material , Description , Image , Item
- { "wood" , "Wood" , "default:wood"},
- { "pine_wood" , "Pinewood" , "default:pine_wood"},
- { "junglewood" , "Junglewood" , "default:junglewood"},
- { "acacia_wood" , "Acacia wood" , "default:acacia_wood"},
- { "aspen_wood" , "Aspen wood" , "default:aspen_wood"},
- }
- for i in ipairs(wood_long_slopes) do
- local mat = wood_long_slopes[i][1]
- local desc = wood_long_slopes[i][2]
- local item = wood_long_slopes[i][3]
- --long slope
- minetest.register_node("mywoodslopes:"..mat.."_slope_long", {
- description = desc.." Slope Long",
- drawtype = "mesh",
- mesh = "six-twelve_slope.obj",
- tiles = {"default_"..mat..".png"},
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
- sounds = default.node_sound_wood_defaults(),
- on_place = minetest.rotate_node,
- collision_box = slope_cbox_long,
- selection_box = slope_cbox_long
- })
- --Inside Corner Long
- minetest.register_node("mywoodslopes:"..mat.."_long_icorner", {
- description = desc.." Long Slope Inside Corner",
- drawtype = "mesh",
- mesh = "six-twelve_slope-ic.obj",
- tiles = {"default_"..mat..".png"},
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
- sounds = default.node_sound_wood_defaults(),
- on_place = minetest.rotate_node,
- collision_box = icorner_cbox_long,
- selection_box = icorner_cbox_long
- })
- --Outside Corner Long
- minetest.register_node("mywoodslopes:"..mat.."_long_ocorner", {
- description = desc.." Long Slope Outside Corner",
- drawtype = "mesh",
- mesh = "six-twelve_slope-oc.obj",
- tiles = {"default_"..mat..".png"},
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
- sounds = default.node_sound_wood_defaults(),
- on_place = minetest.rotate_node,
- collision_box = ocorner_cbox_long,
- selection_box = ocorner_cbox_long
- })
- --rotated---------------------------------------------------------------
- --long slope
- minetest.register_node("mywoodslopes:"..mat.."_slope_long_r", {
- description = desc.." Slope Long Rotated",
- drawtype = "mesh",
- mesh = "six-twelve_slope.obj",
- tiles = {"default_"..mat..".png^[transformR90"},
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
- sounds = default.node_sound_wood_defaults(),
- on_place = minetest.rotate_node,
- collision_box = slope_cbox_long,
- selection_box = slope_cbox_long
- })
- --Inside Corner Long
- minetest.register_node("mywoodslopes:"..mat.."_long_icorner_r", {
- description = desc.." Long Slope Inside Corner",
- drawtype = "mesh",
- mesh = "six-twelve_slope-ic.obj",
- tiles = {"default_"..mat..".png^[transformR90"},
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
- sounds = default.node_sound_wood_defaults(),
- on_place = minetest.rotate_node,
- collision_box = icorner_cbox_long,
- selection_box = icorner_cbox_long
- })
- --Outside Corner Long
- minetest.register_node("mywoodslopes:"..mat.."_long_ocorner_r", {
- description = desc.." Long Slope Outside Corner",
- drawtype = "mesh",
- mesh = "six-twelve_slope-oc.obj",
- tiles = {"default_"..mat..".png^[transformR90"},
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {choppy=2, oddly_breakable_by_hand=2, flammable=3},
- sounds = default.node_sound_wood_defaults(),
- on_place = minetest.rotate_node,
- collision_box = ocorner_cbox_long,
- selection_box = ocorner_cbox_long
- })
- --Crafts--------------------------------------------------------
- --slope long
- minetest.register_craft({
- output = "mywoodslopes:"..mat.."_slope_long 3",
- recipe = {
- {"", "",""},
- {item, "",""},
- {item, item,item},
- }
- })
- --slope icorner
- minetest.register_craft({
- output = "mywoodslopes:"..mat.."_long_icorner 3",
- recipe = {
- {"", item,""},
- {item, item,item},
- {item,"", item},
- }
- })
- --slope ocorner
- minetest.register_craft({
- output = "mywoodslopes:"..mat.."_long_ocorner 3",
- recipe = {
- {item, "",item},
- {item, item,item},
- {"", item,""},
- }
- })
- --rotated-----------------------------------------------
- --slope long
- minetest.register_craft({
- output = "mywoodslopes:"..mat.."_slope_long_r 1",
- recipe = {
- {"", "",""},
- {"", "mywoodslopes:"..mat.."_slope_long",""},
- {"", "",""},
- }
- })
- --slope icorner
- minetest.register_craft({
- output = "mywoodslopes:"..mat.."_long_icorner_r 1",
- recipe = {
- {"", "",""},
- {"", "mywoodslopes:"..mat.."_long_icorner",""},
- {"", "",""},
- }
- })
- --slope ocorner
- minetest.register_craft({
- output = "mywoodslopes:"..mat.."_long_ocorner_r 1",
- recipe = {
- {"", "",""},
- {"", "mywoodslopes:"..mat.."_long_ocorner",""},
- {"", "",""},
- }
- })
- end
|