mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Fix crash when golem tries to pickup item
This commit is contained in:
parent
ec4d431835
commit
9245c85296
1 changed files with 4 additions and 3 deletions
|
@ -48,13 +48,14 @@ mcl_mobs:register_mob("mobs_mc:iron_golem", {
|
||||||
_got_poppy = false,
|
_got_poppy = false,
|
||||||
pick_up = {"mcl_flowers:poppy"},
|
pick_up = {"mcl_flowers:poppy"},
|
||||||
on_pick_up = function(self,n)
|
on_pick_up = function(self,n)
|
||||||
if n.itemstring:find("mcl_flowers:poppy") then
|
local it = ItemStack(n.itemstring)
|
||||||
|
if it:get_name() == "mcl_flowers:poppy" then
|
||||||
if not self._got_poppy then
|
if not self._got_poppy then
|
||||||
self._got_poppy=true
|
self._got_poppy=true
|
||||||
return
|
it:take_item(1)
|
||||||
end
|
end
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
|
return it
|
||||||
end,
|
end,
|
||||||
replace_what = {"mcl_flowers:poppy"},
|
replace_what = {"mcl_flowers:poppy"},
|
||||||
replace_with = {"air"},
|
replace_with = {"air"},
|
||||||
|
|
Loading…
Reference in a new issue