mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-16 23:40:31 +01:00
fixed diamond not consumed when tamed npc
fixed npc follow diamond
This commit is contained in:
parent
3a94bc81b5
commit
64ff460668
|
@ -467,9 +467,9 @@ function mobs:register_mob(name, def)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.type == "npc" and self.order == "follow" and self.state ~= "attack" then
|
if self.type == "npc" and self.order == "follow" and self.owner and self.owner ~= "" and self.state ~= "attack" then
|
||||||
-- npc stop following player if not owner
|
-- npc stop following player if not owner
|
||||||
if self.following and self.type == "npc" and self.owner and self.owner ~= self.following:get_player_name() then
|
if self.following and self.owner and self.owner ~= self.following:get_player_name() then
|
||||||
self.following = nil
|
self.following = nil
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -101,6 +101,7 @@ mobs:register_mob("mobs:npc", {
|
||||||
self.diamond_count = (self.diamond_count or 0) + 1
|
self.diamond_count = (self.diamond_count or 0) + 1
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
item:take_item()
|
item:take_item()
|
||||||
|
clicker:set_wielded_item(item)
|
||||||
end
|
end
|
||||||
if self.diamond_count < 4 then return end
|
if self.diamond_count < 4 then return end
|
||||||
-- if owner switch between follow and stand
|
-- if owner switch between follow and stand
|
||||||
|
|
Loading…
Reference in New Issue
Block a user