diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index a89da65928..66d09ee633 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -14,8 +14,8 @@ minetest.register_craft({ minetest.register_craftitem("mcl_potions:glass_bottle", { description = "Glass Bottle", - inventory_image = "vessels_glass_bottle_inv.png", - wield_image = "vessels_glass_bottle_inv.png", + inventory_image = "mcl_potions_potion_bottle_empty.png", + wield_image = "mcl_potions_potion_bottle_empty.png", groups = {brewitem=1}, }) @@ -27,6 +27,55 @@ minetest.register_craft( { } }) +-- Tempalte function for creating images of filled potions +-- - colorstring must be a ColorString of form “#RRGGBB”, e.g. “#0000FF” for blue. +-- - opacity is optional opacity from 0-255 (default: 127) +local potion_image = function(colorstring, opacity) + if not opacity then + opacity = 127 + end + return "mcl_potions_potion_bottle_drinkable.png^(mcl_potions_potion_overlay.png^[colorize:"..colorstring..":"..tostring(opacity)..")" +end + +-- Itemstring of potions is “mcl_potions:potion_” + +minetest.register_craftitem("mcl_potions:potion_water", { + description = "Water Bottle", + stack_max = 1, + inventory_image = potion_image("#0000FF"), + wield_image = potion_image("#0000FF"), + groups = {brewitem=1, food=3}, + on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), + on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), +}) +minetest.register_craftitem("mcl_potions:potion_awkward", { + description = "Awkward Potion", + stack_max = 1, + inventory_image = potion_image("#0000FF"), + wield_image = potion_image("#0000FF"), + groups = {brewitem=1, food=3}, + on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), + on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), +}) +minetest.register_craftitem("mcl_potions:potion_mundane", { + description = "Mundane Potion", + stack_max = 1, + inventory_image = potion_image("#0000FF"), + wield_image = potion_image("#0000FF"), + groups = {brewitem=1, food=3}, + on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), + on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), +}) +minetest.register_craftitem("mcl_potions:potion_thick", { + description = "Thick Potion", + stack_max = 1, + inventory_image = potion_image("#0000FF"), + wield_image = potion_image("#0000FF"), + groups = {brewitem=1, food=3}, + on_place = minetest.item_eat(0, "mcl_potions:glass_bottle"), + on_secondary_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), +}) + minetest.register_craftitem("mcl_potions:speckled_melon", { description = "Glistering Melon", stack_max = 64, diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_drinkable.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_drinkable.png new file mode 100644 index 0000000000..3d216ef68d Binary files /dev/null and b/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_drinkable.png differ diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_empty.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_empty.png new file mode 100644 index 0000000000..e6e6f0621b Binary files /dev/null and b/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_bottle_empty.png differ diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_overlay.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_overlay.png new file mode 100644 index 0000000000..856685e28c Binary files /dev/null and b/mods/ITEMS/mcl_potions/textures/mcl_potions_potion_overlay.png differ diff --git a/mods/ITEMS/mcl_potions/textures/vessels_glass_bottle_inv.png b/mods/ITEMS/mcl_potions/textures/vessels_glass_bottle_inv.png deleted file mode 100644 index d069155ad7..0000000000 Binary files a/mods/ITEMS/mcl_potions/textures/vessels_glass_bottle_inv.png and /dev/null differ