Stairs: Add glass and obsidian glass. Fix slab combine bug
authorTumeniNodes <tumeninodes@gmail.com>
Tue, 9 Oct 2018 19:44:15 +0000 (15:44 -0400)
committerParamat <paramat@users.noreply.github.com>
Tue, 9 Oct 2018 19:44:15 +0000 (20:44 +0100)
Fix slabs combining into a cube: Facedir is only set for the cube if it has
paramtype2 = "facedir". This avoids liquid appearing in connected
framed glasslike.

mods/stairs/README.txt
mods/stairs/init.lua
mods/stairs/textures/stairs_glass_outer_stairside.png [new file with mode: 0644]
mods/stairs/textures/stairs_glass_split.png [new file with mode: 0644]
mods/stairs/textures/stairs_glass_stairside.png [new file with mode: 0644]
mods/stairs/textures/stairs_obsidian_glass_outer_stairside.png [new file with mode: 0644]
mods/stairs/textures/stairs_obsidian_glass_split.png [new file with mode: 0644]
mods/stairs/textures/stairs_obsidian_glass_stairside.png [new file with mode: 0644]

index c6b8c3377b7635c80358bebfdafeb94b69fada29..8a3d8ea29065df72e6c24bdd5cb424e1eee88870 100644 (file)
@@ -7,3 +7,18 @@ Authors of source code
 Originally by Kahrl <kahrl@gmx.net> (LGPLv2.1+) and
 celeron55, Perttu Ahola <celeron55@gmail.com> (LGPLv2.1+)
 Various Minetest developers and contributors (LGPLv2.1+)
+
+Authors of media (textures)
+---------------------------
+
+Textures
+--------
+Copyright (c) 2018 Shara RedCat (CC BY-SA 3.0)
+ stairs_obsidian_glass_outer_stairside.png -- Derived from a texture by PilzAdam (CC BY-SA 3.0)
+ stairs_obsidian_glass_stairside.png -- Derived from a texture by PilzAdam (CC BY-SA 3.0)
+
+Copyright (c) 2018 TumeniNodes (CC BY-SA 3.0):
+ stairs_glass_outer_stairside.png -- Derived from a texture by celeron55 (CC BY-SA 3.0)
+ stairs_glass_stairside.png -- Derived from a texture by celeron55 (CC BY-SA 3.0)
+ default_glass_split -- Derived from a texture by celeron55 (CC BY-SA 3.0)
+ default_obsidian_glass_split -- Derived from a texture by PilzAdam (CC BY-SA 3.0)
index 59bd0377b013c61e46b46cdfd23538c1b15339cd..53a56e24240bf77a83977ad6a183f68a7bba1aab 100644 (file)
@@ -211,6 +211,12 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
                                                        player_name)
                                                return
                                        end
+                                       -- If paramtype2 of cubic version is not 'facedir' set its
+                                       -- param2 to 0 to avoid bugs such as liquid in connected
+                                       -- framed glass.
+                                       if minetest.registered_nodes[recipeitem].paramtype2 ~= "facedir" then
+                                               p2 = 0
+                                       end
                                        minetest.set_node(pointed_thing.under, {name = recipeitem, param2 = p2})
                                        if not creative_enabled then
                                                itemstack:take_item()
@@ -855,3 +861,97 @@ stairs.register_stair_and_slab(
        default.node_sound_snow_defaults(),
        true
 )
+
+-- Glass stair nodes need to be registered individually to utilize specialized textures.
+
+stairs.register_stair(
+       "glass",
+       "default:glass",
+       {cracky = 3},
+       {"stairs_glass_split.png", "default_glass.png",
+       "stairs_glass_stairside.png^[transformFX", "stairs_glass_stairside.png",
+       "default_glass.png", "stairs_glass_split.png"},
+       "Glass Stair",
+       default.node_sound_glass_defaults(),
+       false
+)
+
+stairs.register_slab(
+       "glass",
+       "default:glass",
+       {cracky = 3},
+       {"default_glass.png", "default_glass.png", "stairs_glass_split.png"},
+       "Glass Slab",
+       default.node_sound_glass_defaults(),
+       false
+)
+
+stairs.register_stair_inner(
+       "glass",
+       "default:glass",
+       {cracky = 3},
+       {"stairs_glass_stairside.png^[transformR270", "default_glass.png",
+       "stairs_glass_stairside.png^[transformFX", "default_glass.png",
+       "default_glass.png", "stairs_glass_stairside.png"},
+       "Glass Inner Stair",
+       default.node_sound_glass_defaults(),
+       false
+)
+
+stairs.register_stair_outer(
+       "glass",
+       "default:glass",
+       {cracky = 3},
+       {"stairs_glass_stairside.png^[transformR90", "default_glass.png",
+       "stairs_glass_outer_stairside.png", "stairs_glass_stairside.png",
+       "stairs_glass_stairside.png^[transformR90","stairs_glass_outer_stairside.png"},
+       "Glass Outer Stair",
+       default.node_sound_glass_defaults(),
+       false
+)
+
+stairs.register_stair(
+       "obsidian_glass",
+       "default:obsidian_glass",
+       {cracky = 3},
+       {"stairs_obsidian_glass_split.png", "default_obsidian_glass.png",
+       "stairs_obsidian_glass_stairside.png^[transformFX", "stairs_obsidian_glass_stairside.png",
+       "default_obsidian_glass.png", "stairs_obsidian_glass_split.png"},
+       "Obsidian Glass Stair",
+       default.node_sound_glass_defaults(),
+       false
+)
+
+stairs.register_slab(
+       "obsidian_glass",
+       "default:obsidian_glass",
+       {cracky = 3},
+       {"default_obsidian_glass.png", "default_obsidian_glass.png", "stairs_obsidian_glass_split.png"},
+       "Obsidian Glass Slab",
+       default.node_sound_glass_defaults(),
+       false
+)
+
+stairs.register_stair_inner(
+       "obsidian_glass",
+       "default:obsidian_glass",
+       {cracky = 3},
+       {"stairs_obsidian_glass_stairside.png^[transformR270", "default_obsidian_glass.png",
+       "stairs_obsidian_glass_stairside.png^[transformFX", "default_obsidian_glass.png",
+       "default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png"},
+       "Obsidian Glass Inner Stair",
+       default.node_sound_glass_defaults(),
+       false
+)
+
+stairs.register_stair_outer(
+       "obsidian_glass",
+       "default:obsidian_glass",
+       {cracky = 3},
+       {"stairs_obsidian_glass_stairside.png^[transformR90", "default_obsidian_glass.png",
+       "stairs_obsidian_glass_outer_stairside.png", "stairs_obsidian_glass_stairside.png",
+       "stairs_obsidian_glass_stairside.png^[transformR90","stairs_obsidian_glass_outer_stairside.png"},
+       "Obsidian Glass Outer Stair",
+       default.node_sound_glass_defaults(),
+       false
+)
diff --git a/mods/stairs/textures/stairs_glass_outer_stairside.png b/mods/stairs/textures/stairs_glass_outer_stairside.png
new file mode 100644 (file)
index 0000000..f0b9442
Binary files /dev/null and b/mods/stairs/textures/stairs_glass_outer_stairside.png differ
diff --git a/mods/stairs/textures/stairs_glass_split.png b/mods/stairs/textures/stairs_glass_split.png
new file mode 100644 (file)
index 0000000..13ddff3
Binary files /dev/null and b/mods/stairs/textures/stairs_glass_split.png differ
diff --git a/mods/stairs/textures/stairs_glass_stairside.png b/mods/stairs/textures/stairs_glass_stairside.png
new file mode 100644 (file)
index 0000000..49e3034
Binary files /dev/null and b/mods/stairs/textures/stairs_glass_stairside.png differ
diff --git a/mods/stairs/textures/stairs_obsidian_glass_outer_stairside.png b/mods/stairs/textures/stairs_obsidian_glass_outer_stairside.png
new file mode 100644 (file)
index 0000000..979f11e
Binary files /dev/null and b/mods/stairs/textures/stairs_obsidian_glass_outer_stairside.png differ
diff --git a/mods/stairs/textures/stairs_obsidian_glass_split.png b/mods/stairs/textures/stairs_obsidian_glass_split.png
new file mode 100644 (file)
index 0000000..7647b9b
Binary files /dev/null and b/mods/stairs/textures/stairs_obsidian_glass_split.png differ
diff --git a/mods/stairs/textures/stairs_obsidian_glass_stairside.png b/mods/stairs/textures/stairs_obsidian_glass_stairside.png
new file mode 100644 (file)
index 0000000..a117cdd
Binary files /dev/null and b/mods/stairs/textures/stairs_obsidian_glass_stairside.png differ