From 7be008936eab8e17bdc4de1811411071821eb294 Mon Sep 17 00:00:00 2001 From: kilbith Date: Fri, 8 Apr 2016 14:29:48 +0200 Subject: [PATCH] Flowers: Fix itemstack when waterlily is placed --- mods/flowers/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index f5e6d2cf..d5581d0c 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -229,12 +229,16 @@ minetest.register_node("flowers:waterlily", { fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5} }, - on_place = function(_, _, pointed_thing) + on_place = function(itemstack, _, pointed_thing) local pos = pointed_thing.above local node = minetest.get_node(pointed_thing.under).name local def = minetest.registered_nodes[node] if def and def.liquidtype == "source" and minetest.get_item_group(node, "water") > 0 then minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + return itemstack + end end end }) -- 2.25.1