summaryrefslogtreecommitdiff
path: root/games/devtest/mods/stairs
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-05-26 00:17:52 +0200
committerGitHub <noreply@github.com>2020-05-26 00:17:52 +0200
commit083b285f4319c470f307f0b52f03a2fb68facd38 (patch)
treebdd02540ad58756a38606f03a995ab837a176709 /games/devtest/mods/stairs
parentb546e8938d41aa9e3101fb9d4d5b02924ed73b60 (diff)
downloadminetest-083b285f4319c470f307f0b52f03a2fb68facd38.tar.gz
minetest-083b285f4319c470f307f0b52f03a2fb68facd38.tar.bz2
minetest-083b285f4319c470f307f0b52f03a2fb68facd38.zip
Rename “Minimal development test” to “Development Test” (#9928)
Diffstat (limited to 'games/devtest/mods/stairs')
-rw-r--r--games/devtest/mods/stairs/init.lua65
-rw-r--r--games/devtest/mods/stairs/mod.conf3
2 files changed, 68 insertions, 0 deletions
diff --git a/games/devtest/mods/stairs/init.lua b/games/devtest/mods/stairs/init.lua
new file mode 100644
index 000000000..2701cabab
--- /dev/null
+++ b/games/devtest/mods/stairs/init.lua
@@ -0,0 +1,65 @@
+stairs = {}
+
+-- Node will be called stairs:stair_<subname>
+function stairs.register_stair(subname, recipeitem, groups, images, description)
+ minetest.register_node(":stairs:stair_" .. subname, {
+ description = description,
+ drawtype = "nodebox",
+ tiles = images,
+ paramtype = "light",
+ paramtype2 = "facedir",
+ is_ground_content = true,
+ groups = groups,
+ 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},
+ },
+ },
+ })
+end
+
+-- Node will be called stairs:slab_<subname>
+function stairs.register_slab(subname, recipeitem, groups, images, description)
+ minetest.register_node(":stairs:slab_" .. subname, {
+ description = description,
+ drawtype = "nodebox",
+ tiles = images,
+ paramtype = "light",
+ is_ground_content = true,
+ groups = groups,
+ node_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
+ },
+ })
+end
+
+-- Nodes will be called stairs:{stair,slab}_<subname>
+function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab)
+ stairs.register_stair(subname, recipeitem, groups, images, desc_stair)
+ stairs.register_slab(subname, recipeitem, groups, images, desc_slab)
+end
+
+stairs.register_stair_and_slab("stone", "basenodes:stone",
+ {cracky=3},
+ {"default_stone.png"},
+ "Stone Stair",
+ "Stone Slab")
+
+stairs.register_stair_and_slab("desert_stone", "basenodes:desert_stone",
+ {cracky=3},
+ {"default_desert_stone.png"},
+ "Desert Stone Stair",
+ "Desert Stone Slab")
+
+stairs.register_stair_and_slab("cobble", "basenodes:cobble",
+ {cracky=3},
+ {"default_cobble.png"},
+ "Cobblestone Stair",
+ "Cobblestone Slab")
diff --git a/games/devtest/mods/stairs/mod.conf b/games/devtest/mods/stairs/mod.conf
new file mode 100644
index 000000000..724bff881
--- /dev/null
+++ b/games/devtest/mods/stairs/mod.conf
@@ -0,0 +1,3 @@
+name = stairs
+description = Adds stairs and slabs
+depends = basenodes