diff options
author | tenplus1 <tenplus1@users.noreply.github.com> | 2018-06-14 09:16:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-14 09:16:18 +0100 |
commit | e601b9d139e9bb860b1f50397a9748e5e21875d6 (patch) | |
tree | 93077f6b7f7b593c6ef7eaf28bc4acda8a2b9fd8 | |
parent | 39d8e35463ff734677a25ecf7525d8a1d0d14a3c (diff) |
stairs no longer dependency
This will only register hemp_block stairs if mod running.
-rw-r--r-- | crops/hemp.lua | 33 |
1 files 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 |