diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index fb3e9d366b..8485471a8c 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -107,9 +107,25 @@ function mcl_cauldrons.take_small_cauldron(pos, itemstack, user, sounds) local number = mcl_cauldrons.add_cauldron_level(pos, mcl_cauldrons.registered_cauldrons[nn.name].name, -1) if number ~= 0 then if sounds then minetest.sound_play(sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true) end - return ItemStack(mcl_cauldrons.registered_cauldrons[nn.name].bottle) + local item_name = mcl_cauldrons.registered_cauldrons[nn.name].bottle + local inv = placer:get_inventory() + minetest.sound_play("mcl_potions_bottle_fill", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) + if minetest.is_creative_enabled(placer:get_player_name()) then + -- Don't replace empty bottle in creative for convenience reasons + if not inv:contains_item("main", water_bottle) then + inv:add_item("main", water_bottle) + end + elseif itemstack:get_count() == 1 then + return water_bottle + else + if inv:room_for_item("main", water_bottle) then + inv:add_item("main", water_bottle) + else + minetest.add_item(placer:get_pos(), water_bottle) + end + itemstack:take_item() + end end - return itemstack else local number = mcl_cauldrons.add_cauldron_level(pos, mcl_cauldrons.registered_cauldrons[nn.name].name, -1) if number ~= 0 then diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index df9d2803cf..b41cd7c13f 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -81,7 +81,9 @@ minetest.register_craftitem("mcl_potions:glass_bottle", { minetest.record_protection_violation(pointed_thing.under, pname) return itemstack end - local itemstack = mcl_cauldrons.take_small_cauldron(pointed_thing.under, itemstack, placer, {dug = "mcl_potions_bottle_fill"}) + local added = mcl_cauldrons.take_small_cauldron(pointed_thing.under, itemstack, placer, {dug = "mcl_potions_bottle_fill"}) + if added == itemstack then + end if get_water then local water_bottle if river_water then