From dbec7b6550bc405c73d690c926fa50f8b2a8229d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 29 Aug 2019 18:40:21 +0200 Subject: [PATCH] Fix filled buckets not emptying properly --- mods/default/bucket.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/default/bucket.lua b/mods/default/bucket.lua index 89365d8..1dd936e 100644 --- a/mods/default/bucket.lua +++ b/mods/default/bucket.lua @@ -9,7 +9,7 @@ local filled_buckets = { for b=1, #filled_buckets do local bucket = filled_buckets[b] minetest.register_craftitem( - "default:"..bucket[1], + "default:bucket_"..bucket[1], { description = bucket[2], inventory_image = bucket[3], @@ -24,9 +24,13 @@ for b=1, #filled_buckets do local inv=user:get_inventory() - if inv:room_for_item("main", {name="default:bucket"}) then + if itemstack:get_count() == 1 then + itemstack:set_name("default:bucket") + elseif inv:room_for_item("main", {name="default:bucket"}) then + itemstack:take_item() inv:add_item("main", "default:bucket") else + itemstack:take_item() local pos = user:get_pos() pos.y = math.floor(pos.y + 0.5) minetest.add_item(pos, "default:bucket")