From 934ac7180bb0b1a8987afa21b49d6bee27584cff Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Tue, 22 Feb 2022 22:15:16 -0500 Subject: [PATCH] make it game agnostic --- dyes-crafting.lua | 24 +++++++++++++----------- mod.conf | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/dyes-crafting.lua b/dyes-crafting.lua index f9baa53..9d8c8bf 100644 --- a/dyes-crafting.lua +++ b/dyes-crafting.lua @@ -87,19 +87,21 @@ for y = 1, 14 do -- colors 0 and 15 are black and white, default dyes end end -minetest.override_item("dye:grey", { - inventory_image = "unifieddyes_dye.png^[colorize:#888888:200", -}) +if minetest.get_modpath("dye") then + minetest.override_item("dye:grey", { + inventory_image = "unifieddyes_dye.png^[colorize:#888888:200", + }) -minetest.override_item("dye:dark_grey", { - inventory_image = "unifieddyes_dye.png^[colorize:#444444:200", -}) + minetest.override_item("dye:dark_grey", { + inventory_image = "unifieddyes_dye.png^[colorize:#444444:200", + }) -minetest.register_craftitem(":dye:light_grey", { - description = S("Light grey Dye"), - inventory_image = "unifieddyes_dye.png^[colorize:#cccccc:200", - groups = { dye=1, not_in_creative_inventory=1 }, -}) + minetest.register_craftitem(":dye:light_grey", { + description = S("Light grey Dye"), + inventory_image = "unifieddyes_dye.png^[colorize:#cccccc:200", + groups = { dye=1, not_in_creative_inventory=1 }, + }) +end -- build a table of color <-> palette associations to reduce the need for -- realtime lookups with getpaletteidx() diff --git a/mod.conf b/mod.conf index 8afae56..df14260 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = unifieddyes description = Unified Dyes expands the standard dye set from 15 to 90 colors. -depends = default, dye, basic_materials +optional_depends = default, dye, basic_materials min_minetest_version = 5.2.0