diff options
Diffstat (limited to 'nodes_feldweg.lua')
-rw-r--r-- | nodes_feldweg.lua | 114 |
1 files changed, 94 insertions, 20 deletions
diff --git a/nodes_feldweg.lua b/nodes_feldweg.lua index bb21479..e424e15 100644 --- a/nodes_feldweg.lua +++ b/nodes_feldweg.lua @@ -2,7 +2,7 @@ -- decoration and building material --------------------------------------------------------------------------------------- -- * includes a wagon wheel that can be used as decoration on walls or to build (stationary) wagons --- * dirt road - those are more natural in small old villages than cobble roads +-- * Dirt road - those are more natural in small old villages than cobble roads -- * loam - no, old buildings are usually not built out of clay; loam was used -- * straw - useful material for roofs -- * glass pane - an improvement compared to fence posts as windows :-) @@ -11,7 +11,7 @@ local S = cottages.S -- supported modes: --- * simple: only a straight dirt road; no curves, junctions etc. +-- * simple: only a straight Dirt road; no curves, junctions etc. -- * flat: each node is a full node; junction, t-junction and corner are included -- * nodebox: like flat - except that each node has a nodebox that fits to that road node -- * mesh: like nodebox - except that it uses a nice roundish model @@ -19,10 +19,51 @@ if( not( cottages_feldweg_mode )) then cottages_feldweg_mode = "mesh"; end ---- a nice dirt road for small villages or paths to fields +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", { - description = S("dirt road"), + description = S("Dirt road"), tiles = {"cottages_feldweg.png","default_dirt.png", "default_dirt.png^default_grass_side.png"}, paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, @@ -41,7 +82,7 @@ end if( cottages_feldweg_mode == "flat" ) then minetest.register_node("cottages:feldweg_crossing", { - description = S("dirt road crossing"), + description = S("Dirt road crossing"), tiles = {"cottages_feldweg_kreuzung.png","default_dirt.png", "default_dirt.png^default_grass_side.png"}, paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, @@ -52,7 +93,7 @@ if( cottages_feldweg_mode == "flat" ) then }) minetest.register_node("cottages:feldweg_t_junction", { - description = S("dirt road t junction"), + description = S("Dirt road t junction"), tiles = {"cottages_feldweg_t-kreuzung.png^[transform2","default_dirt.png", "default_dirt.png^default_grass_side.png"}, paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, @@ -63,7 +104,7 @@ if( cottages_feldweg_mode == "flat" ) then }) minetest.register_node("cottages:feldweg_curve", { - description = S("dirt road curve"), + description = S("Dirt road curve"), tiles = {"cottages_feldweg_ecke.png^[transform2","default_dirt.png", "default_dirt.png^default_grass_side.png"}, paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, @@ -72,13 +113,14 @@ if( cottages_feldweg_mode == "flat" ) then sounds = default.node_sound_dirt_defaults, is_ground_content = false, }) - + + register_recipes(false) -- -- cube-style nodebox version -- elseif( cottages_feldweg_mode == "nodebox" ) then minetest.register_node("cottages:feldweg", { - description = S("dirt road"), + description = S("Dirt road"), tiles = {"cottages_feldweg_orig.png","default_dirt.png", "default_dirt.png^default_grass_side.png"}, paramtype2 = "facedir", roups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, @@ -110,7 +152,7 @@ elseif( cottages_feldweg_mode == "nodebox" ) then }) minetest.register_node("cottages:feldweg_crossing", { - description = S("dirt road crossing"), + description = S("Dirt road crossing"), tiles = {"cottages_feldweg_kreuzung.png","default_dirt.png", "default_dirt.png^default_grass_side.png"}, paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, @@ -156,7 +198,7 @@ elseif( cottages_feldweg_mode == "nodebox" ) then }) minetest.register_node("cottages:feldweg_t_junction", { - description = S("dirt road t junction"), + description = S("Dirt road t junction"), tiles = {"cottages_feldweg_t-kreuzung.png^[transform2","default_dirt.png", "default_dirt.png^default_grass_side.png"}, paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, @@ -200,7 +242,7 @@ elseif( cottages_feldweg_mode == "nodebox" ) then }) minetest.register_node("cottages:feldweg_curve", { - description = S("dirt road curve"), + description = S("Dirt road curve"), tiles = {"cottages_feldweg_ecke.png^[transform2","default_dirt.png", "default_dirt.png^default_grass_side.png"}, paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, @@ -243,15 +285,17 @@ elseif( cottages_feldweg_mode == "nodebox" ) then }, }) + register_recipes(false) + -- -- the mesh version (rounded); provided and created by VanessaE -- elseif( cottages_feldweg_mode == "mesh" ) then - -- a nice dirt road for small villages or paths to fields + -- a nice Dirt road for small villages or paths to fields minetest.register_node("cottages:feldweg", { - description = S("dirt road"), + description = S("Dirt road"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, @@ -269,7 +313,7 @@ elseif( cottages_feldweg_mode == "mesh" ) then minetest.register_node("cottages:feldweg_crossing", { - description = S("dirt road crossing"), + description = S("Dirt road crossing"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, @@ -284,8 +328,10 @@ elseif( cottages_feldweg_mode == "mesh" ) then mesh = "feldweg-crossing.obj", }) + + minetest.register_node("cottages:feldweg_t_junction", { - description = S("dirt road t junction"), + description = S("Dirt road t junction"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, @@ -299,9 +345,11 @@ elseif( cottages_feldweg_mode == "mesh" ) then drawtype = "mesh", mesh = "feldweg-T-junction.obj", }) + + minetest.register_node("cottages:feldweg_curve", { - description = S("dirt road curve"), + description = S("Dirt road curve"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, @@ -316,8 +364,10 @@ elseif( cottages_feldweg_mode == "mesh" ) then mesh = "feldweg-curve.obj", }) + + minetest.register_node("cottages:feldweg_end", { - description = S("dirt road end"), + description = S("Dirt road end"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, @@ -332,6 +382,11 @@ elseif( cottages_feldweg_mode == "mesh" ) then drawtype = "mesh", mesh = "feldweg_end.obj", }) + + + register_recipes(true) + + end @@ -366,7 +421,7 @@ if( cottages_feldweg_mode == "nodebox" or cottages_feldweg_mode == "mesh" ) then }}; minetest.register_node("cottages:feldweg_slope", { - description = S("dirt road slope"), + description = S("Dirt road slope"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, @@ -385,8 +440,10 @@ 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"), + description = S("Dirt road slope long"), paramtype2 = "facedir", groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, legacy_facedir_simple = true, @@ -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 |