From dbd4307f409766cab47c44185e0264be7dc3cb19 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 30 Oct 2018 10:50:47 +0000 Subject: [PATCH] added craft for pint sized potion --- blocks.lua | 33 +++++++++++++++++++++++++++ textures/lucky_pint_sized_potion.png | Bin 0 -> 166 bytes 2 files changed, 33 insertions(+) create mode 100644 textures/lucky_pint_sized_potion.png diff --git a/blocks.lua b/blocks.lua index d7e6a56..0755067 100644 --- a/blocks.lua +++ b/blocks.lua @@ -166,6 +166,38 @@ local function pint(pos, player) end, player) 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) local function bushy(pos, player) @@ -197,6 +229,7 @@ lucky_block:add_blocks({ {"cus", pint}, {"cus", bushy}, {"cus", punchy}, + {"dro", {"lucky_block:pint_sized_potion"}, 1}, }) -- wool mod diff --git a/textures/lucky_pint_sized_potion.png b/textures/lucky_pint_sized_potion.png new file mode 100644 index 0000000000000000000000000000000000000000..cd4d1721532e8b170813757bc760e01264c97e81 GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^4e$wZ%`eIg(~(!RYm9SsFpb(} z6m@LT>NEB=+us8fFqQ=Q1v5B2yO9Ru*n7G-hHzX@PH9G_UKX1se;nNU^e5J1w3rR*Hu=OB`34xFfeRaVy~zW**p(u6oaR$ KpUXO@geCwTLNiJL literal 0 HcmV?d00001