From 92ee402971023748b8f5dbfeabba5a5187fbe50b Mon Sep 17 00:00:00 2001 From: kabou Date: Thu, 22 Dec 2022 22:44:21 +0100 Subject: [PATCH] Separate white dye from bone meal. * Add craftitem for ":mcl_bone_meal:bone_meal" to mcl_dye (temporarily.) * Add crafting recipe for bone meal. * Add texture for white dye item. * Merge craftitem registration for "mcl_dye:white" with generic dyes. * Add crafting recipe for white dye. * Add legacy conversion recipe. * Update dyes table. * Update translations. * Update mcl_crimson and sweet berry on_rightclick handlers. * Update composter output, both as freestanding and to hoppers. * Update bone block crafting recipes. * Update tropical fish, cod and salmon mob drops. --- mods/ENTITIES/mobs_mc/cod.lua | 2 +- mods/ENTITIES/mobs_mc/salmon.lua | 2 +- mods/ENTITIES/mobs_mc/tropical_fish.lua | 2 +- mods/ITEMS/mcl_composters/init.lua | 4 +- mods/ITEMS/mcl_core/crafting.lua | 8 +-- mods/ITEMS/mcl_crimson/init.lua | 8 +-- mods/ITEMS/mcl_dye/init.lua | 53 ++++++++++-------- mods/ITEMS/mcl_dye/locale/mcl_dye.de.tr | 2 +- mods/ITEMS/mcl_dye/locale/mcl_dye.es.tr | 2 +- mods/ITEMS/mcl_dye/locale/mcl_dye.fr.tr | 2 +- mods/ITEMS/mcl_dye/locale/mcl_dye.pl.tr | 2 +- mods/ITEMS/mcl_dye/locale/mcl_dye.ru.tr | 2 +- mods/ITEMS/mcl_dye/locale/mcl_dye.zh_TW.tr | 2 +- mods/ITEMS/mcl_dye/locale/template.txt | 2 +- .../textures/mcl_bone_meal_bone_meal.png | Bin 0 -> 165 bytes mods/ITEMS/mcl_dye/textures/mcl_dye_white.png | Bin 165 -> 201 bytes mods/ITEMS/mcl_farming/sweet_berry.lua | 2 +- mods/ITEMS/mcl_hoppers/init.lua | 2 +- 18 files changed, 51 insertions(+), 46 deletions(-) create mode 100644 mods/ITEMS/mcl_dye/textures/mcl_bone_meal_bone_meal.png diff --git a/mods/ENTITIES/mobs_mc/cod.lua b/mods/ENTITIES/mobs_mc/cod.lua index 24f3131b3..bc65faebe 100644 --- a/mods/ENTITIES/mobs_mc/cod.lua +++ b/mods/ENTITIES/mobs_mc/cod.lua @@ -64,7 +64,7 @@ local cod = { chance = 1, min = 1, max = 1,}, - {name = "mcl_dye:white", + {name = "mcl_bone_meal:bone_meal", chance = 20, min = 1, max = 1,}, diff --git a/mods/ENTITIES/mobs_mc/salmon.lua b/mods/ENTITIES/mobs_mc/salmon.lua index f53648244..873d4bb74 100644 --- a/mods/ENTITIES/mobs_mc/salmon.lua +++ b/mods/ENTITIES/mobs_mc/salmon.lua @@ -42,7 +42,7 @@ local salmon = { chance = 1, min = 1, max = 1,}, - {name = "mcl_dye:white", + {name = "mcl_bone_meal:bone_meal", chance = 20, min = 1, max = 1,}, diff --git a/mods/ENTITIES/mobs_mc/tropical_fish.lua b/mods/ENTITIES/mobs_mc/tropical_fish.lua index 47f59a92e..bb9b63f64 100644 --- a/mods/ENTITIES/mobs_mc/tropical_fish.lua +++ b/mods/ENTITIES/mobs_mc/tropical_fish.lua @@ -87,7 +87,7 @@ local tropical_fish = { chance = 1, min = 1, max = 1,}, - {name = "mcl_dye:white", + {name = "mcl_bone_meal:bone_meal", chance = 20, min = 1, max = 1,}, diff --git a/mods/ITEMS/mcl_composters/init.lua b/mods/ITEMS/mcl_composters/init.lua index 56422d8b5..e1e39aefc 100644 --- a/mods/ITEMS/mcl_composters/init.lua +++ b/mods/ITEMS/mcl_composters/init.lua @@ -138,8 +138,8 @@ local function composter_harvest(pos, node, player, itemstack, pointed_thing) end -- reset ready type composter to empty type swap_node(pos, {name="mcl_composters:composter"}) - -- spawn bone meal item (wtf dye?! is this how they make white cocoa) - add_item(pos, "mcl_dye:white") + -- spawn bone meal item + add_item(pos, "mcl_bone_meal:bone_meal") -- TODO play some sounds return itemstack end diff --git a/mods/ITEMS/mcl_core/crafting.lua b/mods/ITEMS/mcl_core/crafting.lua index c98f0969a..ffba04a7b 100644 --- a/mods/ITEMS/mcl_core/crafting.lua +++ b/mods/ITEMS/mcl_core/crafting.lua @@ -126,14 +126,14 @@ minetest.register_craft({ minetest.register_craft({ output = "mcl_core:bone_block", recipe = { - { "mcl_dye:white", "mcl_dye:white", "mcl_dye:white" }, - { "mcl_dye:white", "mcl_dye:white", "mcl_dye:white" }, - { "mcl_dye:white", "mcl_dye:white", "mcl_dye:white" }, + { "mcl_bone_meal:bone_meal", "mcl_bone_meal:bone_meal", "mcl_bone_meal:bone_meal" }, + { "mcl_bone_meal:bone_meal", "mcl_bone_meal:bone_meal", "mcl_bone_meal:bone_meal" }, + { "mcl_bone_meal:bone_meal", "mcl_bone_meal:bone_meal", "mcl_bone_meal:bone_meal" }, }, }) minetest.register_craft({ - output = "mcl_dye:white 9", + output = "mcl_bone_meal:bone_meal 9", recipe = { { "mcl_core:bone_block" }, }, diff --git a/mods/ITEMS/mcl_crimson/init.lua b/mods/ITEMS/mcl_crimson/init.lua index 8170000b3..ba680cff5 100644 --- a/mods/ITEMS/mcl_crimson/init.lua +++ b/mods/ITEMS/mcl_crimson/init.lua @@ -82,7 +82,7 @@ minetest.register_node("mcl_crimson:warped_fungus", { }, node_placement_prediction = "", on_rightclick = function(pos, node, pointed_thing, player, itemstack) - if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then + if pointed_thing:get_wielded_item():get_name() == "mcl_bone_meal:bone_meal" then local nodepos = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) if nodepos.name == "mcl_crimson:warped_nylium" or nodepos.name == "mcl_nether:netherrack" then local random = math.random(1, 5) @@ -129,7 +129,7 @@ minetest.register_node("mcl_crimson:twisting_vines", { itemstack:take_item() end grow_vines(pos, 1, "mcl_crimson:twisting_vines") - elseif clicker:get_wielded_item():get_name() == "mcl_dye:white" then + elseif clicker:get_wielded_item():get_name() == "mcl_bone_meal:bone_meal" then if not minetest.is_creative_enabled(clicker:get_player_name()) then itemstack:take_item() end @@ -185,7 +185,7 @@ minetest.register_node("mcl_crimson:weeping_vines", { itemstack:take_item() end grow_vines(pos, 1, "mcl_crimson:weeping_vines", -1) - elseif clicker:get_wielded_item():get_name() == "mcl_dye:white" then + elseif clicker:get_wielded_item():get_name() == "mcl_bone_meal:bone_meal" then if not minetest.is_creative_enabled(clicker:get_player_name()) then itemstack:take_item() end @@ -421,7 +421,7 @@ minetest.register_node("mcl_crimson:crimson_fungus", { }, node_placement_prediction = "", on_rightclick = function(pos, node, pointed_thing, player) - if pointed_thing:get_wielded_item():get_name() == "mcl_dye:white" then + if pointed_thing:get_wielded_item():get_name() == "mcl_bone_meal:bone_meal" then local nodepos = minetest.get_node(vector.offset(pos, 0, -1, 0)) if nodepos.name == "mcl_crimson:crimson_nylium" or nodepos.name == "mcl_nether:netherrack" then local random = math.random(1, 5) diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 6c3ea93f0..fc03a9e42 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -67,7 +67,7 @@ local dyelocal = {} -- This collection of colors is partly a historic thing, partly something else. dyelocal.dyes = { - {"white", "mcl_dye_white", S("Bone Meal"), {dye=1, craftitem=1, basecolor_white=1, excolor_white=1, unicolor_white=1}}, + {"white", "mcl_dye_white", S("White Dye"), {dye=1, craftitem=1, basecolor_white=1, excolor_white=1, unicolor_white=1}}, {"grey", "dye_grey", S("Light Grey Dye"), {dye=1, craftitem=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1}}, {"dark_grey", "dye_dark_grey", S("Grey Dye"), {dye=1, craftitem=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}}, {"black", "mcl_dye_black", S("Black Dye"), {dye=1, craftitem=1, basecolor_black=1, excolor_black=1, unicolor_black=1}}, @@ -109,22 +109,19 @@ end -- Define items for _, row in ipairs(dyelocal.dyes) do local name = row[1] - -- White dye is defined explicitly below - if name ~= "white" then - local img = row[2] - local description = row[3] - local groups = row[4] - local item_name = "mcl_dye:"..name - local item_image = img..".png" - minetest.register_craftitem(item_name, { - inventory_image = item_image, - description = description, - _doc_items_longdesc = S("This item is a dye which is used for dyeing and crafting."), - _doc_items_usagehelp = S("Rightclick on a sheep to dye its wool. Other things are dyed by crafting."), - groups = groups, - stack_max = 64, - }) - end + local img = row[2] + local description = row[3] + local groups = row[4] + local item_name = "mcl_dye:"..name + local item_image = img..".png" + minetest.register_craftitem(item_name, { + inventory_image = item_image, + description = description, + _doc_items_longdesc = S("This item is a dye which is used for dyeing and crafting."), + _doc_items_usagehelp = S("Rightclick on a sheep to dye its wool. Other things are dyed by crafting."), + groups = groups, + stack_max = 64, + }) end -- Bone Meal @@ -381,14 +378,13 @@ end mcl_dye.apply_bone_meal = apply_bone_meal -minetest.register_craftitem("mcl_dye:white", { - inventory_image = "mcl_dye_white.png", +minetest.register_craftitem(":mcl_bone_meal:bone_meal", { + inventory_image = "mcl_bone_meal_bone_meal.png", description = S("Bone Meal"), _tt_help = S("Speeds up plant growth"), _doc_items_longdesc = S("Bone meal is a white dye and also useful as a fertilizer to speed up the growth of many plants."), _doc_items_usagehelp = S("Rightclick a sheep to turn its wool white. Rightclick a plant to speed up its growth. Note that not all plants can be fertilized like this. When you rightclick a grass block, tall grass and flowers will grow all over the place."), stack_max = 64, - groups = dyelocal.dyes[1][4], on_place = function(itemstack, user, pointed_thing) -- Use pointed node's on_rightclick function first, if present local node = minetest.get_node(pointed_thing.under) @@ -421,6 +417,11 @@ minetest.register_craftitem("mcl_dye:white", { _dispense_into_walkable = true }) +minetest.register_craft({ + output = "mcl_bone_meal:bone_meal 3", + recipe = {{"mcl_mobitems:bone"}}, +}) + -- Dye mixing minetest.register_craft({ type = "shapeless", @@ -487,6 +488,10 @@ minetest.register_craft({ }) -- Dye creation +minetest.register_craft({ + output = "mcl_dye:white", + recipe = {{"mcl_bone_meal:bone_meal"}}, +}) minetest.register_craft({ output = "mcl_dye:black", recipe = {{"mcl_mobitems:ink_sac"}}, @@ -565,13 +570,13 @@ minetest.register_craft({ recipe = "mcl_core:cactus", cooktime = 10, }) -minetest.register_craft({ - output = "mcl_dye:white 3", - recipe = {{"mcl_mobitems:bone"}}, -}) -- legacy item grace conversion recipes +minetest.register_craft({ + output = "mcl_bone_meal:bone_meal", + recipe = {{"mcl_dye:white"}}, +}) minetest.register_craft({ output = "mcl_mobitems:ink_sac", recipe = {{"mcl_dye:black"}}, diff --git a/mods/ITEMS/mcl_dye/locale/mcl_dye.de.tr b/mods/ITEMS/mcl_dye/locale/mcl_dye.de.tr index 8af2a82f3..ca56dff22 100644 --- a/mods/ITEMS/mcl_dye/locale/mcl_dye.de.tr +++ b/mods/ITEMS/mcl_dye/locale/mcl_dye.de.tr @@ -1,5 +1,5 @@ # textdomain: mcl_dye -Bone Meal=Knochenmehl +White Dye=Weißer Farbstoff Light Grey Dye=Hellgrauer Farbstoff Grey Dye=Grauer Farbstoff Black Dye=Schwarzer Farbstoff diff --git a/mods/ITEMS/mcl_dye/locale/mcl_dye.es.tr b/mods/ITEMS/mcl_dye/locale/mcl_dye.es.tr index af2194bf3..14c2c12d1 100644 --- a/mods/ITEMS/mcl_dye/locale/mcl_dye.es.tr +++ b/mods/ITEMS/mcl_dye/locale/mcl_dye.es.tr @@ -1,5 +1,5 @@ # textdomain: mcl_dye -Bone Meal=Harina de hueso +White Dye=Tinte blanca Light Grey Dye=Tinte gris claro Grey Dye=Tinte gris Black Dye=Tinte negro diff --git a/mods/ITEMS/mcl_dye/locale/mcl_dye.fr.tr b/mods/ITEMS/mcl_dye/locale/mcl_dye.fr.tr index 42fc96279..9418225d6 100644 --- a/mods/ITEMS/mcl_dye/locale/mcl_dye.fr.tr +++ b/mods/ITEMS/mcl_dye/locale/mcl_dye.fr.tr @@ -1,5 +1,5 @@ # textdomain: mcl_dye -Bone Meal=Poudre d'Os +White Dye=Teinture Blanche Light Grey Dye=Teinture Gris Clair Grey Dye=Teinture Gris Black Dye=Teinture Noire diff --git a/mods/ITEMS/mcl_dye/locale/mcl_dye.pl.tr b/mods/ITEMS/mcl_dye/locale/mcl_dye.pl.tr index f8d159e19..e9d8e4173 100644 --- a/mods/ITEMS/mcl_dye/locale/mcl_dye.pl.tr +++ b/mods/ITEMS/mcl_dye/locale/mcl_dye.pl.tr @@ -1,5 +1,5 @@ # textdomain: mcl_dye -Bone Meal=Mączka kostna +White Dye=Biały farba Light Grey Dye=Jasnoszara farba Grey Dye=Szara farba Black Dye=Czarny farba diff --git a/mods/ITEMS/mcl_dye/locale/mcl_dye.ru.tr b/mods/ITEMS/mcl_dye/locale/mcl_dye.ru.tr index dbca4a610..4e7903132 100644 --- a/mods/ITEMS/mcl_dye/locale/mcl_dye.ru.tr +++ b/mods/ITEMS/mcl_dye/locale/mcl_dye.ru.tr @@ -1,5 +1,5 @@ # textdomain: mcl_dye -Bone Meal=Костная мука +White Dye=Белый краситель Light Grey Dye=Светло-серый краситель Grey Dye=Серый краситель Black Dye=Чёрный краситель diff --git a/mods/ITEMS/mcl_dye/locale/mcl_dye.zh_TW.tr b/mods/ITEMS/mcl_dye/locale/mcl_dye.zh_TW.tr index 78cca1319..5e236e9dd 100644 --- a/mods/ITEMS/mcl_dye/locale/mcl_dye.zh_TW.tr +++ b/mods/ITEMS/mcl_dye/locale/mcl_dye.zh_TW.tr @@ -1,5 +1,5 @@ # textdomain: mcl_dye -Bone Meal=骨粉 +White Dye=白色染料 Light Grey Dye=淺灰色染料 Grey Dye=灰色染料 Black Dye=黑色染料 diff --git a/mods/ITEMS/mcl_dye/locale/template.txt b/mods/ITEMS/mcl_dye/locale/template.txt index 44f3889ab..a40b0859a 100644 --- a/mods/ITEMS/mcl_dye/locale/template.txt +++ b/mods/ITEMS/mcl_dye/locale/template.txt @@ -1,5 +1,5 @@ # textdomain: mcl_dye -Bone Meal= +White Dye= Light Grey Dye= Grey Dye= Black Dye= diff --git a/mods/ITEMS/mcl_dye/textures/mcl_bone_meal_bone_meal.png b/mods/ITEMS/mcl_dye/textures/mcl_bone_meal_bone_meal.png new file mode 100644 index 0000000000000000000000000000000000000000..bc06c2865e8538268866e4a1e864e8c26a60be3f GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^3h)VW{r~^}r`I>{U)^=#$l}R$ z(c4!{j9>aV5h%-8666=m;PC858j$1Y>Eakt!B~4RP_Wg2hhf8)d*AMxi!hk8`Z$u&s bthNFG;HeJeZM+R400000NkvXXu0mjfO>9E4 delta 137 zcmV;40CxY$0i^+uB!3c6OjJex|Nrvq+27T=(8QyYep|Pwkzb|bVE_OC0d!JMQvg8b z*k%9#06|GaK~#7FeZf%?g)j^Nu=L*c-!~KhHw8>UHQ-+i1~?L*h6EM~_%9%?0^6?y rVv)T#O776bc_)b3CK#na^XdTtTLc7UKYdF80000