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 if minetest.get_item_group(nn, "cauldron") ~= 0 then
-- Put water into cauldron -- Put water into cauldron
if nn ~= "mcl_cauldrons:cauldron_3" then if nn ~= "mcl_cauldrons:cauldron_3" then
mcl_cauldrons.set_cauldron(pos, "water", 3) mcl_cauldrons.set_cauldron_level(pos, "water", 3)
end end
sound_place("mcl_core:water_source", pos) sound_place("mcl_core:water_source", pos)
return false return false

View File

@ -4,7 +4,7 @@ mcl_cauldrons = {}
-- Cauldron mod, adds cauldrons. -- Cauldron mod, adds cauldrons.
local function give_item(user, itemstack) 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 if itemstack:get_count() == 1 then
return itemstack return itemstack
else else
@ -16,6 +16,7 @@ local function give_item(user, itemstack)
end end
end end
end end
return itemstack
end end
-- Convenience function because the cauldron nodeboxes are very similar -- 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 if user and not minetest.is_creative_enabled(user:get_player_name()) then
minetest.set_node(pos, {name="mcl_cauldrons:cauldron"}) 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 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 else
minetest.set_node(pos, {name="mcl_cauldrons:cauldron"}) 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 if sounds then minetest.sound_play(sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true) end