From 7bda846ea7f8c3ad127b167e6c7a797bfd46f73f Mon Sep 17 00:00:00 2001 From: Christian Danscheid Date: Sat, 10 Aug 2013 19:23:52 +0200 Subject: Initial commit --- asphaltstairs/depends.txt | 2 ++ asphaltstairs/function.lua | 56 ++++++++++++++++++++++++++++++++++++++++++++++ asphaltstairs/init.lua | 15 +++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 asphaltstairs/depends.txt create mode 100644 asphaltstairs/function.lua create mode 100644 asphaltstairs/init.lua (limited to 'asphaltstairs') diff --git a/asphaltstairs/depends.txt b/asphaltstairs/depends.txt new file mode 100644 index 0000000..48ef5e1 --- /dev/null +++ b/asphaltstairs/depends.txt @@ -0,0 +1,2 @@ +default +streetsmod \ No newline at end of file diff --git a/asphaltstairs/function.lua b/asphaltstairs/function.lua new file mode 100644 index 0000000..9879d4c --- /dev/null +++ b/asphaltstairs/function.lua @@ -0,0 +1,56 @@ +-- StreetsMod needs a special slab definition, so it needs its own register_stair_and_slab +streets.register_stair_and_slab = function(node,desc,tile,item) + minetest.register_node(":streets:"..node.."_stair",{ + description = desc.."stair", + groups = {cracky = 3}, + tiles = tile, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5} + } + } + }) + minetest.register_node(":streets:"..node.."_slab",{ + description = desc.." slab", + groups = {cracky = 3}, + tiles = tile, + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + } + } + }) + minetest.register_craft({ + output = "streets:"..node.."_stair 4", + recipe = { + {"","",item}, + {"",item,item}, + {item,item,item} + } + }) + minetest.register_craft({ + output = "streets:"..node.."_stair 4", + recipe = { + {item,"",""}, + {item,item,""}, + {item,item,item} + } + }) + minetest.register_craft({ + output = "streets:"..node.."_slab 3", + recipe = { + {"","",""}, + {"","",""}, + {item,item,item} + } + }) +end \ No newline at end of file diff --git a/asphaltstairs/init.lua b/asphaltstairs/init.lua new file mode 100644 index 0000000..1e206ab --- /dev/null +++ b/asphaltstairs/init.lua @@ -0,0 +1,15 @@ +--[[ + StreetsMod: These stairs are just a workaround until stairs/stairs+ and circular_saw + can work together without problems. This definetly needs an API! +]] +if streets.extendedBy.stairs == false then return end +-- +dofile(minetest.get_modpath(minetest.get_current_modname()).."/function.lua") + +-- Asphalt +streets.register_stair_and_slab("asphalt","Asphalt",{"streets_asphalt.png"},"streets:asphalt") +minetest.register_alias("streets:asphalt_stairs","streets:asphalt_stair") +-- Asphalt with solid line: +streets.register_stair_and_slab("asphalt_solid_line","Asphalt with solid line",{"streets_asphalt.png^streets_asphalt_solid_line.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_solid_line.png"},"streets:asphalt_solid_line") +-- Asphalt with dashed line: +streets.register_stair_and_slab("asphalt_dashed_line","Asphalt with dashed line",{"streets_asphalt.png^streets_asphalt_dashed_line.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_dashed_line.png"},"streets:asphalt_dashed_line") -- cgit v1.2.3