From 5f7bea5726ae990afb6d97f90bacdd7b8d9b729f Mon Sep 17 00:00:00 2001
From: Milan Ihl <tchncs@vivaldi.net>
Date: Wed, 20 May 2020 14:06:37 +0200
Subject: [PATCH] marsdoors: add moreblocks registrations

---
 mods/marsdoors/moreblocks.lua | 98 +++++++++++++++++++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 mods/marsdoors/moreblocks.lua

diff --git a/mods/marsdoors/moreblocks.lua b/mods/marsdoors/moreblocks.lua
new file mode 100644
index 00000000..718b7ba1
--- /dev/null
+++ b/mods/marsdoors/moreblocks.lua
@@ -0,0 +1,98 @@
+stairsplus:register_all("marsdoors", "shieldblock", "marsdoors:shieldblock", {
+    description = "Shieldblock",
+    tiles = {"marsdoors_shieldblock.png"},
+    groups = {cracky=1},
+    sounds = default.node_sound_stone_defaults(),
+})
+
+stairsplus:register_all("marsdoors", "steelwallblock", "marsdoors:steelwallblock", {
+    description = "Steelwallblock",
+    tiles = {"marsdoors_wall.png"},
+    groups = {cracky=1},
+    sounds = default.node_sound_stone_defaults(),
+})
+
+stairsplus:register_all("marsdoors", "oxogen", "marsdoors:oxogen", {
+    description = "Oxogen Block",
+    tiles = {"marsdoors_oxogen.png"},
+    groups = {crumbly = 2},
+    sounds = default.node_sound_glass_defaults(),
+})
+
+stairsplus:register_all("marsdoors", "warning", "marsdoors:warning", {
+    description = "Warning tape block",
+    tiles = {"marsdoors_warntape.png"},
+    groups = {cracky = 2},
+    sounds = default.node_sound_stone_defaults(),
+})
+
+table.insert(circular_saw.known_stairs, "marsdoors:shieldblock")
+table.insert(circular_saw.known_stairs, "marsdoors:steelwallblock")
+table.insert(circular_saw.known_stairs, "marsdoors:oxogen")
+table.insert(circular_saw.known_stairs, "marsdoors:warning")
+
+-- and now for the aliases
+
+local saw_names = {
+	{"micro", "_1"},
+	{"panel", "_1"},
+	{"micro", "_2"},
+	{"panel", "_2"},
+	{"micro", "_4"},
+	{"panel", "_4"},
+	{"micro", ""},
+	{"panel", ""},
+
+	{"micro", "_12"},
+	{"panel", "_12"},
+	{"micro", "_14"},
+	{"panel", "_14"},
+	{"micro", "_15"},
+	{"panel", "_15"},
+	{"stair", "_outer"},
+	{"stair", ""},
+
+	{"stair", "_inner"},
+	{"slab", "_1"},
+	{"slab", "_2"},
+	{"slab", "_quarter"},
+	{"slab", ""},
+	{"slab", "_three_quarter"},
+	{"slab", "_14"},
+	{"slab", "_15"},
+
+	{"slab", "_two_sides"},
+	{"slab", "_three_sides"},
+	{"slab", "_three_sides_u"},
+	{"stair", "_half"},
+	{"stair", "_alt_1"},
+	{"stair", "_alt_2"},
+	{"stair", "_alt_4"},
+	{"stair", "_alt"},
+
+	{"slope", ""},
+	{"slope", "_half"},
+	{"slope", "_half_raised"},
+	{"slope", "_inner"},
+	{"slope", "_inner_half"},
+	{"slope", "_inner_half_raised"},
+	{"slope", "_inner_cut"},
+	{"slope", "_inner_cut_half"},
+
+	{"slope", "_inner_cut_half_raised"},
+	{"slope", "_outer"},
+	{"slope", "_outer_half"},
+	{"slope", "_outer_half_raised"},
+	{"slope", "_outer_cut"},
+	{"slope", "_outer_cut_half"},
+	{"slope", "_outer_cut_half_raised"},
+	{"slope", "_cut"},
+}
+
+for i = 1, #saw_names do
+    local t = saw_names[i]
+    minetest.register_alias("stairs" .. ":" .. t[1] .. "_" .. "shieldblock" .. t[2], "marsdoors" .. ":" .. t[1] .. "_" .. "shieldblock" .. t[2])
+    minetest.register_alias("stairs" .. ":" .. t[1] .. "_" .. "steelwallblock" .. t[2], "marsdoors" .. ":" .. t[1] .. "_" .. "steelwallblock" .. t[2])
+    minetest.register_alias("stairs" .. ":" .. t[1] .. "_" .. "oxogen" .. t[2], "marsdoors" .. ":" .. t[1] .. "_" .. "oxogen" .. t[2])
+    minetest.register_alias("stairs" .. ":" .. t[1] .. "_" .. "warning" .. t[2], "marsdoors" .. ":" .. t[1] .. "_" .. "warning" .. t[2])
+end
\ No newline at end of file
-- 
GitLab