diff options
Diffstat (limited to 'cottages/nodes_feldweg.lua')
-rw-r--r-- | cottages/nodes_feldweg.lua | 108 |
1 files changed, 91 insertions, 17 deletions
diff --git a/cottages/nodes_feldweg.lua b/cottages/nodes_feldweg.lua index bb21479..d81cc02 100644 --- a/cottages/nodes_feldweg.lua +++ b/cottages/nodes_feldweg.lua @@ -19,6 +19,47 @@ if( not( cottages_feldweg_mode )) then cottages_feldweg_mode = "mesh"; end +local function register_recipes(include_end) + + minetest.register_craft({ + output = "cottages:feldweg_crossing 5", + recipe = { + {"", "cottages:feldweg", "" }, + {"cottages:feldweg", "cottages:feldweg", "cottages:feldweg"}, + {"", "cottages:feldweg", "" }, + }, + }) + + minetest.register_craft({ + output = "cottages:feldweg_t_junction 5", + recipe = { + {"", "cottages:feldweg", "" }, + {"", "cottages:feldweg", "" }, + {"cottages:feldweg", "cottages:feldweg", "cottages:feldweg"} + + }, + }) + + minetest.register_craft({ + output = "cottages:feldweg_curve 5", + recipe = { + {"cottages:feldweg", "", "" }, + {"cottages:feldweg", "", ""}, + {"cottages:feldweg", "cottages:feldweg", "cottages:feldweg"} + }, + }) + + if include_end then + minetest.register_craft({ + output = "cottages:feldweg_end 5", + recipe = { + {"cottages:feldweg", "", "cottages:feldweg" }, + {"cottages:feldweg", "cottages:feldweg", "cottages:feldweg"} + }, + }) + end +end + --- a nice dirt road for small villages or paths to fields if( cottages_feldweg_mode == "simple" or cottages_feldweg_mode == "flat" ) then minetest.register_node("cottages:feldweg", { @@ -28,7 +69,7 @@ if( cottages_feldweg_mode == "simple" or cottages_feldweg_mode == "flat" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, }) end @@ -47,7 +88,7 @@ if( cottages_feldweg_mode == "flat" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, }) @@ -58,7 +99,7 @@ if( cottages_feldweg_mode == "flat" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, }) @@ -69,10 +110,11 @@ if( cottages_feldweg_mode == "flat" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, }) - + + register_recipes(false) -- -- cube-style nodebox version -- @@ -84,7 +126,7 @@ elseif( cottages_feldweg_mode == "nodebox" ) then roups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, drawtype = "nodebox", -- top, bottom, side1, side2, inner, outer @@ -116,7 +158,7 @@ elseif( cottages_feldweg_mode == "nodebox" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, drawtype = "nodebox", @@ -162,7 +204,7 @@ elseif( cottages_feldweg_mode == "nodebox" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, drawtype = "nodebox", @@ -206,7 +248,7 @@ elseif( cottages_feldweg_mode == "nodebox" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, drawtype = "nodebox", @@ -243,6 +285,8 @@ elseif( cottages_feldweg_mode == "nodebox" ) then }, }) + register_recipes(false) + -- -- the mesh version (rounded); provided and created by VanessaE @@ -256,7 +300,7 @@ elseif( cottages_feldweg_mode == "mesh" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, tiles = {"cottages_feldweg_end.png","default_dirt.png^default_grass_side.png", "default_dirt.png", "default_grass.png", @@ -274,7 +318,7 @@ elseif( cottages_feldweg_mode == "mesh" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, tiles = {"cottages_feldweg_end.png","default_dirt.png", "default_grass.png","cottages_feldweg_surface.png", @@ -284,13 +328,15 @@ elseif( cottages_feldweg_mode == "mesh" ) then mesh = "feldweg-crossing.obj", }) + + minetest.register_node("cottages:feldweg_t_junction", { description = S("dirt road t junction"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, tiles = {"cottages_feldweg_end.png","default_dirt.png^default_grass_side.png", "default_dirt.png", "default_grass.png","cottages_feldweg_surface.png", @@ -299,6 +345,8 @@ elseif( cottages_feldweg_mode == "mesh" ) then drawtype = "mesh", mesh = "feldweg-T-junction.obj", }) + + minetest.register_node("cottages:feldweg_curve", { description = S("dirt road curve"), @@ -306,7 +354,7 @@ elseif( cottages_feldweg_mode == "mesh" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, tiles = {"default_dirt.png^default_grass_side.png","default_grass.png", "default_dirt.png^default_grass_side.png","cottages_feldweg_surface.png", @@ -316,13 +364,15 @@ elseif( cottages_feldweg_mode == "mesh" ) then mesh = "feldweg-curve.obj", }) + + minetest.register_node("cottages:feldweg_end", { description = S("dirt road end"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, tiles = {"cottages_feldweg_end.png","default_dirt.png^default_grass_side.png", "default_dirt.png", "default_grass.png", @@ -332,6 +382,11 @@ elseif( cottages_feldweg_mode == "mesh" ) then drawtype = "mesh", mesh = "feldweg_end.obj", }) + + + register_recipes(true) + + end @@ -342,7 +397,7 @@ if( minetest.get_modpath("stairs") and stairs and stairs.register_stair_and_slab {"cottages_feldweg.png","default_dirt.png", "default_grass.png","default_grass.png","cottages_feldweg.png","cottages_feldweg.png"}, S("Dirt Road Stairs"), S("Dirt Road, half height"), - default.node_sound_dirt_defaults) + cottages.sounds.dirt) end if( cottages_feldweg_mode == "nodebox" or cottages_feldweg_mode == "mesh" ) then @@ -371,7 +426,7 @@ if( cottages_feldweg_mode == "nodebox" or cottages_feldweg_mode == "mesh" ) then groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, tiles = {"cottages_feldweg_end.png","default_dirt.png^default_grass_side.png", "default_dirt.png", "default_grass.png", @@ -385,13 +440,15 @@ if( cottages_feldweg_mode == "nodebox" or cottages_feldweg_mode == "mesh" ) then selection_box = box_slope, }) + + minetest.register_node("cottages:feldweg_slope_long", { description = S("dirt road slope long"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, groups = {crumbly=3}, - sounds = default.node_sound_dirt_defaults, + sounds = cottages.sounds.dirt, is_ground_content = false, tiles = {"cottages_feldweg_end.png","default_dirt.png^default_grass_side.png", "default_dirt.png", "default_grass.png", @@ -403,4 +460,21 @@ if( cottages_feldweg_mode == "nodebox" or cottages_feldweg_mode == "mesh" ) then collision_box = box_slope_long, selection_box = box_slope_long, }) + + + minetest.register_craft({ + output = "cottages:feldweg_slope 3", + recipe = { + {"cottages:feldweg", "", "" }, + {"cottages:feldweg", "cottages:feldweg", ""} + }, + }) + + minetest.register_craft({ + output = "cottages:feldweg_slope_long 4", + recipe = { + {"cottages:feldweg", "", "" }, + {"cottages:feldweg", "cottages:feldweg", "cottages:feldweg"} + }, + }) end |