handle optional dependencies better

This commit is contained in:
whosit 2024-02-13 09:12:54 +03:00
parent ff729567fa
commit f5ed551863
2 changed files with 5 additions and 2 deletions

View File

@ -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",

View File

@ -1,2 +1,3 @@
name = yl_dice
description = Simple 6-sided dice
optional_depends = yl_nether, dye