From f5ed551863d5991c6ad68c3d824c35fc097c846c Mon Sep 17 00:00:00 2001 From: whosit Date: Tue, 13 Feb 2024 09:12:54 +0300 Subject: [PATCH] handle optional dependencies better --- init.lua | 6 ++++-- mod.conf | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 707375f..52cd0d2 100644 --- a/init.lua +++ b/init.lua @@ -107,8 +107,7 @@ minetest.register_node("yl_dice:dice", { local BASE_BLOCK -if minetest.get_modpath("yl_nether") then - -- FIXME check if this item is actually registered +if minetest.registered_items["yl_nether:ivory_block"] then BASE_BLOCK = "yl_nether:ivory_block" end @@ -122,6 +121,9 @@ if BASE_BLOCK then { "", "", "" }, } }) +end + +if minetest.registered_items["dye:red"] then local colors = { "red", "blue", diff --git a/mod.conf b/mod.conf index 0d76aa6..af9d657 100644 --- a/mod.conf +++ b/mod.conf @@ -1,2 +1,3 @@ name = yl_dice description = Simple 6-sided dice +optional_depends = yl_nether, dye