diff --git a/mods/ITEMS/mcl_farming/melon.lua b/mods/ITEMS/mcl_farming/melon.lua index 3a1c27643..fa8929c01 100644 --- a/mods/ITEMS/mcl_farming/melon.lua +++ b/mods/ITEMS/mcl_farming/melon.lua @@ -60,6 +60,10 @@ local stem_drop = { -- Growing unconnected stems +local startcolor = { r = 0x2E , g = 0x9D, b = 0x2E } +local endcolor = { r = 0xFF , g = 0xA8, b = 0x00 } + + for s=1,7 do local h = s / 8 local doc = s == 1 @@ -68,6 +72,7 @@ for s=1,7 do entry_name = "Premature Melon Stem" longdesc = "Melon stems grow on farmland in 8 stages. On hydrated farmland, the growth is a bit quicker. Mature melon stems are able to grow melons." end + local colorstring = mcl_farming:stem_color(startcolor, endcolor, s, 8) minetest.register_node("mcl_farming:melontige_"..s, { description = string.format("Premature Melon Stem (Stage %d)", s), _doc_items_create_entry = doc, @@ -78,7 +83,7 @@ for s=1,7 do drawtype = "plantlike", sunlight_propagates = true, drop = stem_drop, - tiles = {"mcl_farming_melontige_"..s..".png"}, + tiles = {"([combine:16x16:0,"..((8-s)*2).."=mcl_farming_melon_stem_disconnected.png)^[colorize:"..colorstring..":127"}, selection_box = { type = "fixed", fixed = { @@ -96,14 +101,14 @@ local stem_def = { description = "Mature Melon Stem", _doc_items_create_entry = true, _doc_items_longdesc = "A mature melon stem attempts to grow a melon at one of its four adjacent blocks. A melon can only grow on top of farmland, dirt, or a grass block. When a melon is next to a melon stem, the melon stem immediately bends and connects to the melon. While connected, a melon stem can't grow another melon. As soon all melons around the stem have been removed, it loses the connection and is ready to grow another melon.", - tiles = {"mcl_farming_melontige_8.png"}, + tiles = {"mcl_farming_melon_stem_disconnected.png^[colorize:#FFA800:127"}, } -- Register stem growth mcl_farming:add_plant("plant_melon_stem", "mcl_farming:melontige_unconnect", {"mcl_farming:melontige_1", "mcl_farming:melontige_2", "mcl_farming:melontige_3", "mcl_farming:melontige_4", "mcl_farming:melontige_5", "mcl_farming:melontige_6", "mcl_farming:melontige_7"}, 30, 5) -- Register actual melon, connected stems and stem-to-melon growth -mcl_farming:add_gourd("mcl_farming:melontige_unconnect", "mcl_farming:melontige_linked", "mcl_farming:melontige_unconnect", stem_def, stem_drop, "mcl_farming:melon", melon_base_def, 25, 15, "mcl_farming_melon_stem_connected.png") +mcl_farming:add_gourd("mcl_farming:melontige_unconnect", "mcl_farming:melontige_linked", "mcl_farming:melontige_unconnect", stem_def, stem_drop, "mcl_farming:melon", melon_base_def, 25, 15, "mcl_farming_melon_stem_connected.png^[colorize:#FFA800:127") -- Items and crafting minetest.register_craftitem("mcl_farming:melon_item", { diff --git a/mods/ITEMS/mcl_farming/pumpkin.lua b/mods/ITEMS/mcl_farming/pumpkin.lua index 9d4c8c228..8a01caf71 100644 --- a/mods/ITEMS/mcl_farming/pumpkin.lua +++ b/mods/ITEMS/mcl_farming/pumpkin.lua @@ -34,6 +34,9 @@ local stem_drop = { -- Unconnected immature stem +local startcolor = { r = 0x2E , g = 0x9D, b = 0x2E } +local endcolor = { r = 0xFF , g = 0xA8, b = 0x00 } + for s=1,7 do local h = s / 8 local doc = s == 1 @@ -42,6 +45,7 @@ for s=1,7 do entry_name = "Premature Pumpkin Stem" longdesc = "Pumpkin stems grow on farmland in 8 stages. On hydrated farmland, the growth is a bit quicker. Mature pumpkin stems are able to grow pumpkins." end + local colorstring = mcl_farming:stem_color(startcolor, endcolor, s, 8) minetest.register_node("mcl_farming:pumpkin_"..s, { description = string.format("Premature Pumpkin Stem (Stage %d)", s), _doc_items_entry_name = entry_name, @@ -52,7 +56,7 @@ for s=1,7 do drawtype = "plantlike", sunlight_propagates = true, drop = stem_drop, - tiles = {"mcl_farming_pumpkintige_"..s..".png"}, + tiles = {"([combine:16x16:0,"..((8-s)*2).."=mcl_farming_pumpkin_stem_disconnected.png)^[colorize:"..colorstring..":127"}, selection_box = { type = "fixed", fixed = { @@ -69,7 +73,7 @@ end local stem_def = { description = "Mature Pumpkin Stem", _doc_items_longdesc = "A mature pumpkin stem attempts to grow a pumpkin at one of its four adjacent blocks. A pumpkin can only grow on top of farmland, dirt or a grass block. When a pumpkin is next to a pumpkin stem, the pumpkin stem immediately bends and connects to the pumpkin. A connected pumpkin stem can't grow another pumpkin. As soon all pumpkins around the stem have been removed, it loses the connection and is ready to grow another pumpkin.", - tiles = {"mcl_farming_pumpkintige_8.png"}, + tiles = {"mcl_farming_pumpkin_stem_disconnected.png^[colorize:#FFA800:127"}, } -- Template for pumpkin @@ -90,7 +94,7 @@ local pumpkin_base_def = { mcl_farming:add_plant("plant_pumpkin_stem", "mcl_farming:pumpkintige_unconnect", {"mcl_farming:pumpkin_1", "mcl_farming:pumpkin_2", "mcl_farming:pumpkin_3", "mcl_farming:pumpkin_4", "mcl_farming:pumpkin_5", "mcl_farming:pumpkin_6", "mcl_farming:pumpkin_7"}, 30, 5) -- Register actual pumpkin, connected stems and stem-to-pumpkin growth -mcl_farming:add_gourd("mcl_farming:pumpkintige_unconnect", "mcl_farming:pumpkintige_linked", "mcl_farming:pumpkintige_unconnect", stem_def, stem_drop, "mcl_farming:pumpkin_face", pumpkin_base_def, 30, 15, "mcl_farming_pumpkin_stem_connected.png", +mcl_farming:add_gourd("mcl_farming:pumpkintige_unconnect", "mcl_farming:pumpkintige_linked", "mcl_farming:pumpkintige_unconnect", stem_def, stem_drop, "mcl_farming:pumpkin_face", pumpkin_base_def, 30, 15, "mcl_farming_pumpkin_stem_connected.png^[colorize:#FFA800:127", function(pos) -- Attempt to spawn iron golem or snow golem mobs_mc.tools.check_iron_golem_summon(pos) diff --git a/mods/ITEMS/mcl_farming/shared_functions.lua b/mods/ITEMS/mcl_farming/shared_functions.lua index 31a4e0aec..5debb5ef8 100644 --- a/mods/ITEMS/mcl_farming/shared_functions.lua +++ b/mods/ITEMS/mcl_farming/shared_functions.lua @@ -363,3 +363,19 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s }) end +-- Used for growing gourd stems. Returns the intermediate color between startcolor and endcolor at a step +-- * startcolor: ColorSpec in table form for the stem in its lowest growing stage +-- * endcolor: ColorSpec in table form for the stem in its final growing stage +-- * step: The nth growth step. Counting starts at 1 +-- * step_count: The number of total growth steps +function mcl_farming:stem_color(startcolor, endcolor, step, step_count) + local color = {} + local function get_component(startt, endd, step, step_count) + return math.floor(math.max(0, math.min(255, (startt + (((step-1)/step_count) * endd))))) + end + color.r = get_component(startcolor.r, endcolor.r, step, step_count) + color.g = get_component(startcolor.g, endcolor.g, step, step_count) + color.b = get_component(startcolor.b, endcolor.b, step, step_count) + local colorstring = string.format("#%02X%02X%02X", color.r, color.g, color.b) + return colorstring +end diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melon_stem_connected.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melon_stem_connected.png index e1ae622db..7c64ce5d1 100644 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melon_stem_connected.png and b/mods/ITEMS/mcl_farming/textures/mcl_farming_melon_stem_connected.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melon_stem_disconnected.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melon_stem_disconnected.png new file mode 100644 index 000000000..82cf606d8 Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_melon_stem_disconnected.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_1.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_1.png deleted file mode 100644 index 50caebdd1..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_1.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_2.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_2.png deleted file mode 100644 index 26a6db6a5..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_2.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_3.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_3.png deleted file mode 100644 index 98ad62697..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_3.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_4.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_4.png deleted file mode 100644 index afb7bbf30..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_4.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_5.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_5.png deleted file mode 100644 index c4bcc5fb1..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_5.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_6.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_6.png deleted file mode 100644 index c0946f108..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_6.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_7.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_7.png deleted file mode 100644 index a9adf08c9..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_7.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_8.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_8.png deleted file mode 100644 index 7936e5fe6..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_melontige_8.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_stem_connected.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_stem_connected.png index e1ae622db..7c64ce5d1 100644 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_stem_connected.png and b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_stem_connected.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_stem_disconnected.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_stem_disconnected.png new file mode 100644 index 000000000..7a3be1f56 Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_stem_disconnected.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_1.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_1.png deleted file mode 100644 index 0321c5d4b..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_1.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_2.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_2.png deleted file mode 100644 index 48eca7011..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_2.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_3.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_3.png deleted file mode 100644 index ba2cba938..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_3.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_4.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_4.png deleted file mode 100644 index ebb1bba4d..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_4.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_5.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_5.png deleted file mode 100644 index e24ec3ff8..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_5.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_6.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_6.png deleted file mode 100644 index 15852a1c3..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_6.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_7.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_7.png deleted file mode 100644 index 12781147f..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_7.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_8.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_8.png deleted file mode 100644 index 2db014d77..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkintige_8.png and /dev/null differ diff --git a/tools/Texture_Conversion_Table.csv b/tools/Texture_Conversion_Table.csv index 63df4a2e6..401f0043c 100644 --- a/tools/Texture_Conversion_Table.csv +++ b/tools/Texture_Conversion_Table.csv @@ -813,3 +813,7 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt /assets/minecraft/textures/blocks,redstone_dust_dot.png,/mods/ITEMS/REDSTONE/mesecons/textures,redstone_redstone_dust_dot.png,,,,,, /assets/minecraft/textures/blocks,redstone_dust_line0.png,/mods/ITEMS/REDSTONE/mesecons/textures,redstone_redstone_dust_line0.png,,,,,, /assets/minecraft/textures/blocks,redstone_dust_line1.png,/mods/ITEMS/REDSTONE/mesecons/textures,redstone_redstone_dust_line1.png,,,,,, +/assets/minecraft/textures/blocks,pumpkin_stem_connected.png,/mods/ITEMS/mcl_farming/textures,mcl_farming_pumpkin_stem_connected.png,,,,,, +/assets/minecraft/textures/blocks,melon_stem_connected.png,/mods/ITEMS/mcl_farming/textures,mcl_farming_melon_stem_connected.png,,,,,, +/assets/minecraft/textures/blocks,pumpkin_stem_disconnected.png,/mods/ITEMS/mcl_farming/textures,mcl_farming_pumpkin_stem_disconnected.png,,,,,, +/assets/minecraft/textures/blocks,melon_stem_disconnected.png,/mods/ITEMS/mcl_farming/textures,mcl_farming_melon_stem_disconnected.png,,,,,,