Don't allow to use empty nametag
This commit is contained in:
parent
15d7764c65
commit
fff0e572aa
|
@ -3608,6 +3608,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
|
||||||
if item:get_name() == "mobs:nametag" then
|
if item:get_name() == "mobs:nametag" then
|
||||||
|
|
||||||
local tag = item:get_meta():get_string("name")
|
local tag = item:get_meta():get_string("name")
|
||||||
|
if tag ~= "" then
|
||||||
if string.len(tag) > 30 then
|
if string.len(tag) > 30 then
|
||||||
tag = string.sub(tag, 1, 30)
|
tag = string.sub(tag, 1, 30)
|
||||||
end
|
end
|
||||||
|
@ -3620,6 +3621,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
|
||||||
player:set_wielded_item(item)
|
player:set_wielded_item(item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user