mirror of
https://notabug.org/TenPlus1/lucky_block.git
synced 2024-11-20 01:53:43 +01:00
added craft for pint sized potion
This commit is contained in:
parent
9e378eeff5
commit
dbd4307f40
33
blocks.lua
33
blocks.lua
@ -166,6 +166,38 @@ local function pint(pos, player)
|
|||||||
end, player)
|
end, player)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.register_craftitem("lucky_block:pint_sized_potion", {
|
||||||
|
description = S("Pint Sized Potion (DRINK ME)"),
|
||||||
|
inventory_image = "lucky_pint_sized_potion.png",
|
||||||
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
|
||||||
|
itemstack:take_item()
|
||||||
|
|
||||||
|
local pos = user:get_pos()
|
||||||
|
local inv = user:get_inventory()
|
||||||
|
local item = "vessels:glass_bottle"
|
||||||
|
|
||||||
|
if inv:room_for_item("main", {name = item}) then
|
||||||
|
inv:add_item("main", item)
|
||||||
|
else
|
||||||
|
minetest.add_item(pos, {name = item})
|
||||||
|
end
|
||||||
|
|
||||||
|
pint(pos, user)
|
||||||
|
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "lucky_block:pint_sized_potion",
|
||||||
|
recipe = {
|
||||||
|
{"default:bush_sapling", "flowers:tulip", "default:acacia_bush_sapling"},
|
||||||
|
{"dye:blue", "default:apple", "dye:cyan"},
|
||||||
|
{"", "vessels:glass_bottle", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
-- custom function (drop player inventory and replace with dry shrubs)
|
-- custom function (drop player inventory and replace with dry shrubs)
|
||||||
local function bushy(pos, player)
|
local function bushy(pos, player)
|
||||||
|
|
||||||
@ -197,6 +229,7 @@ lucky_block:add_blocks({
|
|||||||
{"cus", pint},
|
{"cus", pint},
|
||||||
{"cus", bushy},
|
{"cus", bushy},
|
||||||
{"cus", punchy},
|
{"cus", punchy},
|
||||||
|
{"dro", {"lucky_block:pint_sized_potion"}, 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- wool mod
|
-- wool mod
|
||||||
|
BIN
textures/lucky_pint_sized_potion.png
Normal file
BIN
textures/lucky_pint_sized_potion.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 166 B |
Loading…
Reference in New Issue
Block a user