From e601b9d139e9bb860b1f50397a9748e5e21875d6 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Thu, 14 Jun 2018 09:16:18 +0100 Subject: stairs no longer dependency This will only register hemp_block stairs if mod running. --- crops/hemp.lua | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/crops/hemp.lua b/crops/hemp.lua index dd49134..e3278f9 100644 --- a/crops/hemp.lua +++ b/crops/hemp.lua @@ -111,21 +111,24 @@ minetest.register_craft( { }, }) --- register stairs -if stairs and stairs.mod and stairs.mod == "redo" then - -stairs.register_all("hemp_block", "farming:hemp_block", - {snappy = 1, flammable = 2}, - {"farming_hemp_block.png"}, - "Hemp Block", - default.node_sound_leaves_defaults()) -else - -stairs.register_stair_and_slab("hemp_block", "farming:hemp_block", - {snappy = 1, flammable = 2}, - {"farming_hemp_block.png"}, - "Hemp Block", - default.node_sound_leaves_defaults()) +-- check and register stairs +if minetest.global_exists("stairs") then + + if stairs.mod and stairs.mod == "redo" then + + stairs.register_all("hemp_block", "farming:hemp_block", + {snappy = 1, flammable = 2}, + {"farming_hemp_block.png"}, + "Hemp Block", + default.node_sound_leaves_defaults()) + else + + stairs.register_stair_and_slab("hemp_block", "farming:hemp_block", + {snappy = 1, flammable = 2}, + {"farming_hemp_block.png"}, + "Hemp Block", + default.node_sound_leaves_defaults()) + end end -- paper -- cgit v1.2.3