From cf4d57e584aa625a5de73ea2b5380539d57d59fb Mon Sep 17 00:00:00 2001 From: AFCMS Date: Fri, 19 Mar 2021 14:13:34 +0100 Subject: [PATCH] fix crash --- mods/ITEMS/mcl_buckets/register.lua | 2 +- mods/ITEMS/mcl_cauldrons/init.lua | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_buckets/register.lua b/mods/ITEMS/mcl_buckets/register.lua index 1f5e4e377b..64813103c4 100644 --- a/mods/ITEMS/mcl_buckets/register.lua +++ b/mods/ITEMS/mcl_buckets/register.lua @@ -61,7 +61,7 @@ if mod_mcl_core then if minetest.get_item_group(nn, "cauldron") ~= 0 then -- Put water into cauldron if nn ~= "mcl_cauldrons:cauldron_3" then - mcl_cauldrons.set_cauldron(pos, "water", 3) + mcl_cauldrons.set_cauldron_level(pos, "water", 3) end sound_place("mcl_core:water_source", pos) return false diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index 3b26ac34a1..09fa78c3d0 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -4,7 +4,7 @@ mcl_cauldrons = {} -- Cauldron mod, adds cauldrons. local function give_item(user, itemstack) - if itemstack and user:is_player() and minetest.is_creative_enabled(user:get_player_name()) then + if itemstack and user:is_player() and true then--minetest.is_creative_enabled(user:get_player_name()) then if itemstack:get_count() == 1 then return itemstack else @@ -16,6 +16,7 @@ local function give_item(user, itemstack) end end end + return itemstack end -- Convenience function because the cauldron nodeboxes are very similar @@ -110,7 +111,7 @@ function mcl_cauldrons.take_cauldron(pos, itemstack, user, sounds) if user and not minetest.is_creative_enabled(user:get_player_name()) then minetest.set_node(pos, {name="mcl_cauldrons:cauldron"}) 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].bucket) + return give_item(user, ItemStack(mcl_cauldrons.registered_cauldrons[nn.name].bucket)) else minetest.set_node(pos, {name="mcl_cauldrons:cauldron"}) if sounds then minetest.sound_play(sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true) end