fix crash

This commit is contained in:
AFCMS 2021-03-19 14:13:34 +01:00
parent 890b95bb49
commit cf4d57e584
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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