mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-23 02:51:06 +01:00
Don't allow to use empty nametag
This commit is contained in:
parent
15d7764c65
commit
fff0e572aa
1 changed files with 10 additions and 8 deletions
|
@ -3608,16 +3608,18 @@ 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 string.len(tag) > 30 then
|
if tag ~= "" then
|
||||||
tag = string.sub(tag, 1, 30)
|
if string.len(tag) > 30 then
|
||||||
end
|
tag = string.sub(tag, 1, 30)
|
||||||
self.nametag = tag
|
end
|
||||||
|
self.nametag = tag
|
||||||
|
|
||||||
update_tag(self)
|
update_tag(self)
|
||||||
|
|
||||||
if not mobs.is_creative(name) then
|
if not mobs.is_creative(name) then
|
||||||
item:take_item()
|
item:take_item()
|
||||||
player:set_wielded_item(item)
|
player:set_wielded_item(item)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue