1
0
Fork 0

Add water bottle and base potions

This commit is contained in:
Wuzzy 2017-03-01 16:36:26 +01:00
parent 6544aac4d6
commit 423367083f
5 changed files with 51 additions and 2 deletions

View File

@ -14,8 +14,8 @@ minetest.register_craft({
minetest.register_craftitem("mcl_potions:glass_bottle", { minetest.register_craftitem("mcl_potions:glass_bottle", {
description = "Glass Bottle", description = "Glass Bottle",
inventory_image = "vessels_glass_bottle_inv.png", inventory_image = "mcl_potions_potion_bottle_empty.png",
wield_image = "vessels_glass_bottle_inv.png", wield_image = "mcl_potions_potion_bottle_empty.png",
groups = {brewitem=1}, 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_<NBT Potion Tag>”
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", { minetest.register_craftitem("mcl_potions:speckled_melon", {
description = "Glistering Melon", description = "Glistering Melon",
stack_max = 64, stack_max = 64,

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B