diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a618ac..8479650 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Notable Game Changes: - Added Signs - Improved Fences - Improved Slabs +- Improved Stairs - Added Reinforced Glass - Add back the Rubies that were removed a while ago! diff --git a/mods/ITEMS/pyutest_blocks/api.lua b/mods/ITEMS/pyutest_blocks/api.lua index c73f7aa..27bd9cf 100644 --- a/mods/ITEMS/pyutest_blocks/api.lua +++ b/mods/ITEMS/pyutest_blocks/api.lua @@ -112,8 +112,6 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext floodable = true }, econf)) - PyuTest.make_slab(id_slab, desc .. " Slab", id_block, tex, groups, econf) - core.register_node(id_pillar, PyuTest.util.tableconcat({ description = Translate(desc .. " Pillar"), tiles = tex, @@ -124,16 +122,8 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext sounds = PyuTest.make_node_sounds() }, econf)) - core.register_node(id_stairs, PyuTest.util.tableconcat({ - description = Translate(desc .. " Stairs"), - tiles = tex, - groups = groups, - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "colorfacedir", - node_box = PyuTest.NODE_BOXES.STAIRS, - sounds = PyuTest.make_node_sounds(), - }, econf)) + PyuTest.make_slab(id_slab, desc .. " Slab", id_block, tex, groups, econf) + PyuTest.make_stairs(id_stairs, desc .. " Stairs", id_block, tex, groups, econf) PyuTest.make_fence(id_fence, desc .. " Fence", id_block, tex, groups, econf) PyuTest.make_door(id_door, desc .. " Door", id_block, tex, groups, econf) @@ -154,15 +144,6 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext { id_block } } }) - - core.register_craft({ - output = id_stairs .. " 4", - recipe = { - { id_block, "", "" }, - { id_block, id_block, "" }, - { id_block, id_block, id_block } - } - }) end PyuTest.make_liquid = function(name, desc, groups, texture, speed, extra_conf) diff --git a/mods/ITEMS/pyutest_blocks/api/stairs.lua b/mods/ITEMS/pyutest_blocks/api/stairs.lua index 5c683b6..9d207f8 100644 --- a/mods/ITEMS/pyutest_blocks/api/stairs.lua +++ b/mods/ITEMS/pyutest_blocks/api/stairs.lua @@ -1,3 +1,97 @@ +PyuTest.make_stairs = function(name, desc, craftitem, texture, groups, extra) + local e = extra or {} + local id_inner = name .. "_inner" + local id_outer = name .. "_outer" + + core.register_node(name, PyuTest.util.tableconcat({ + description = Translate(desc), + groups = PyuTest.util.tableconcat(groups, { + block = 1, + slab = 1, + }), + tiles = texture, + sounds = PyuTest.make_node_sounds(), + paramtype = "light", + paramtype2 = "colorfacedir", + + drawtype = "nodebox", + node_box = PyuTest.NODE_BOXES.STAIRS, + on_place = PyuTest.rotate_and_place, + }, e)) + + core.register_node(id_inner, PyuTest.util.tableconcat({ + description = Translate("Inner " .. desc), + groups = PyuTest.util.tableconcat(groups, { + block = 1, + slab = 1, + }), + tiles = texture, + sounds = PyuTest.make_node_sounds(), + paramtype = "light", + paramtype2 = "colorfacedir", + + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, + {-0.5, 0.0, 0.0, 0.5, 0.5, 0.5}, + {-0.5, 0.0, -0.5, 0.0, 0.5, 0.0}, + }, + }, + on_place = PyuTest.rotate_and_place, + }, e)) + + core.register_node(id_outer, PyuTest.util.tableconcat({ + description = Translate("Outer " .. desc), + groups = PyuTest.util.tableconcat(groups, { + block = 1, + slab = 1, + }), + tiles = texture, + sounds = PyuTest.make_node_sounds(), + paramtype = "light", + paramtype2 = "colorfacedir", + + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, + {-0.5, 0.0, 0.0, 0.0, 0.5, 0.5}, + }, + }, + on_place = PyuTest.rotate_and_place, + }, e)) + + if craftitem ~= nil then + core.register_craft({ + output = name .. " 4", + recipe = { + { craftitem, "", "" }, + { craftitem, craftitem, "" }, + { craftitem, craftitem, craftitem } + } + }) + + core.register_craft({ + output = id_inner, + recipe = { + name + }, + type = "shapeless" + }) + + core.register_craft({ + output = id_outer, + recipe = { + id_inner + }, + type = "shapeless" + }) + end +end + PyuTest.make_slab = function(name, desc, craftitem, texture, groups, extra) local e = extra or {}