From 62f9f00fe8363322c5a5d64e84759743c84fc2bb Mon Sep 17 00:00:00 2001
From: Calinou <calinou9999spam@gmail.com>
Date: Mon, 20 Jan 2014 19:49:40 +0100
Subject: Big update: new stair types, code looks better.

---
 stairsplus/microblocks.lua |  28 -------------
 stairsplus/panels.lua      |  28 -------------
 stairsplus/slabs.lua       |  32 --------------
 stairsplus/stairs.lua      | 101 ++++++++++++++++++++++++++-------------------
 4 files changed, 59 insertions(+), 130 deletions(-)

(limited to 'stairsplus')

diff --git a/stairsplus/microblocks.lua b/stairsplus/microblocks.lua
index 6cbb7d4..30a95ea 100644
--- a/stairsplus/microblocks.lua
+++ b/stairsplus/microblocks.lua
@@ -26,10 +26,6 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0, 0, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0, 0, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -48,10 +44,6 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0, -0.4375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0, -0.4375, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -70,10 +62,6 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0, -0.375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0, -0.375, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -92,10 +80,6 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0, -0.25, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0, -0.25, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -114,10 +98,6 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0, 0.25, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0, 0.25, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -136,10 +116,6 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0, 0.375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0, 0.375, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -158,10 +134,6 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0, 0.4375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0, 0.4375, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
diff --git a/stairsplus/panels.lua b/stairsplus/panels.lua
index c0a24fb..f074d54 100644
--- a/stairsplus/panels.lua
+++ b/stairsplus/panels.lua
@@ -26,10 +26,6 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
-		},
 		on_place = stairsplus_rotate_and_place
 	})
 	
@@ -47,10 +43,6 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 0.5},
-		},
 		on_place = stairsplus_rotate_and_place
 	})
 	
@@ -68,10 +60,6 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0.5, -0.375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0.5, -0.375, 0.5},
-		},
 		on_place = stairsplus_rotate_and_place
 	})
 	
@@ -89,10 +77,6 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0.5, -0.25, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0.5, -0.25, 0.5},
-		},
 		on_place = stairsplus_rotate_and_place
 	})
 	
@@ -110,10 +94,6 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0.5, 0.25, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0.5, 0.25, 0.5},
-		},
 		on_place = stairsplus_rotate_and_place
 	})
 	
@@ -131,10 +111,6 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0.5, 0.375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0.5, 0.375, 0.5},
-		},
 		on_place = stairsplus_rotate_and_place
 	})
 	
@@ -152,10 +128,6 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
 			type = "fixed",
 			fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 0.5},
-		},
 		on_place = stairsplus_rotate_and_place
 	})
 
diff --git a/stairsplus/slabs.lua b/stairsplus/slabs.lua
index 1e251a5..687dbee 100644
--- a/stairsplus/slabs.lua
+++ b/stairsplus/slabs.lua
@@ -26,10 +26,6 @@ function register_slab(modname, subname, recipeitem, groups, images, description
 			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},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -47,10 +43,6 @@ function register_slab(modname, subname, recipeitem, groups, images, description
 			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},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -69,10 +61,6 @@ function register_slab(modname, subname, recipeitem, groups, images, description
 			type = "fixed",
 			fixed = {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -91,10 +79,6 @@ function register_slab(modname, subname, recipeitem, groups, images, description
 			type = "fixed",
 			fixed = {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -113,10 +97,6 @@ function register_slab(modname, subname, recipeitem, groups, images, description
 			type = "fixed",
 			fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -135,10 +115,6 @@ function register_slab(modname, subname, recipeitem, groups, images, description
 			type = "fixed",
 			fixed = {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -157,10 +133,6 @@ function register_slab(modname, subname, recipeitem, groups, images, description
 			type = "fixed",
 			fixed = {-0.5, -0.5, -0.5, 0.5, 0.375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, -0.5, 0.5, 0.375, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -179,10 +151,6 @@ function register_slab(modname, subname, recipeitem, groups, images, description
 			type = "fixed",
 			fixed = {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
diff --git a/stairsplus/stairs.lua b/stairsplus/stairs.lua
index 20996a7..b11fef9 100644
--- a/stairsplus/stairs.lua
+++ b/stairsplus/stairs.lua
@@ -28,13 +28,6 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
 				{-0.5, 0, 0, 0.5, 0.5, 0.5},
 			},
 		},
-		selection_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},
-			},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -54,13 +47,6 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
 				{-0.5, 0, 0, 0.5, 0.5, 0.5},
 			},
 		},
-		selection_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},
-			},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -81,13 +67,6 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
 				{-0.5, 0, 0, 0, 0.5, 0.5},
 			},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {
-				{-0.5, -0.5, -0.5, 0, 0, 0.5},
-				{-0.5, 0, 0, 0, 0.5, 0.5},
-			},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -108,13 +87,6 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
 				{0, 0, 0, 0.5, 0.5, 0.5},
 			},
 		},
-		selection_box = {
-			type = "fixed",
-			fixed = {
-				{0, -0.5, -0.5, 0.5, 0, 0.5},
-				{0, 0, 0, 0.5, 0.5, 0.5},
-			},
-		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
@@ -137,24 +109,36 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
 				{-0.5, 0, -0.5, 0, 0.5, 0},
 			},
 		},
-		selection_box = {
+		sounds = default.node_sound_stone_defaults(),
+		on_place = stairsplus_rotate_and_place
+	})
+
+	minetest.register_node(":"..modname .. ":stair_" .. subname .. "_outer", {
+		description = S("%s Stairs"):format(S(description)),
+		drawtype = "nodebox",
+		tiles = images,
+		light_source = light,
+		drop = modname .. ":stair_" .. drop .. "_outer",
+		paramtype = "light",
+		paramtype2 = "facedir",
+		sunlight_propagates = 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},
-				{-0.5, 0, -0.5, 0, 0.5, 0},
+				{-0.5, 0, 0, 0, 0.5, 0.5},
 			},
 		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
 
-	minetest.register_node(":"..modname .. ":stair_" .. subname .. "_outer", {
+	minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_alt", {
 		description = S("%s Stairs"):format(S(description)),
 		drawtype = "nodebox",
 		tiles = images,
 		light_source = light,
-		drop = modname .. ":stair_" .. drop .. "_outer",
 		paramtype = "light",
 		paramtype2 = "facedir",
 		sunlight_propagates = true,
@@ -162,22 +146,35 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
 		node_box = {
 			type = "fixed",
 			fixed = {
-				{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
-				{-0.5, 0, 0, 0, 0.5, 0.5},
+				{-0.5, -0.5, -0.5, 0.5, 0, 0},
+				{-0.5, 0, 0, 0.5, 0.5, 0.5},
 			},
 		},
-		selection_box = {
+		sounds = default.node_sound_stone_defaults(),
+		on_place = stairsplus_rotate_and_place
+	})
+	
+	minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_alt_1", {
+		description = S("%s Stairs"):format(S(description)),
+		drawtype = "nodebox",
+		tiles = images,
+		light_source = light,
+		paramtype = "light",
+		paramtype2 = "facedir",
+		sunlight_propagates = true,
+		groups = groups,
+		node_box = {
 			type = "fixed",
 			fixed = {
-				{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
-				{-0.5, 0, 0, 0, 0.5, 0.5},
+				{-0.5, -0.0625, -0.5, 0.5, 0, 0},
+				{-0.5, 0.4375, 0, 0.5, 0.5, 0.5},
 			},
 		},
 		sounds = default.node_sound_stone_defaults(),
 		on_place = stairsplus_rotate_and_place
 	})
-
-	minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_alt", {
+	
+	minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_alt_2", {
 		description = S("%s Stairs"):format(S(description)),
 		drawtype = "nodebox",
 		tiles = images,
@@ -189,8 +186,28 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
 		node_box = {
 			type = "fixed",
 			fixed = {
-				{-0.5, -0.5, -0.5, 0.5, 0, 0},
-				{-0.5, 0, 0, 0.5, 0.5, 0.5},
+				{-0.5, -0.125, -0.5, 0.5, 0, 0},
+				{-0.5, 0.375, 0, 0.5, 0.5, 0.5},
+			},
+		},
+		sounds = default.node_sound_stone_defaults(),
+		on_place = stairsplus_rotate_and_place
+	})
+	
+	minetest.register_node(":" .. modname .. ":stair_" .. subname .. "_alt_4", {
+		description = S("%s Stairs"):format(S(description)),
+		drawtype = "nodebox",
+		tiles = images,
+		light_source = light,
+		paramtype = "light",
+		paramtype2 = "facedir",
+		sunlight_propagates = true,
+		groups = groups,
+		node_box = {
+			type = "fixed",
+			fixed = {
+				{-0.5, -0.25, -0.5, 0.5, 0, 0},
+				{-0.5, 0.25, 0, 0.5, 0.5, 0.5},
 			},
 		},
 		sounds = default.node_sound_stone_defaults(),
-- 
cgit v1.2.3