mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-03-28 23:10:28 +01:00
allow players with 'protection_bypass' to rename owned tamed mobs
This commit is contained in:
parent
ccbfe93f12
commit
c06d071220
8
api.lua
8
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210406",
|
version = "20210407",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -4730,12 +4730,12 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local item = clicker:get_wielded_item()
|
local item = clicker:get_wielded_item()
|
||||||
|
local name = clicker:get_player_name()
|
||||||
|
|
||||||
-- if mob has been tamed you can name it with a nametag
|
-- if mob has been tamed you can name it with a nametag
|
||||||
if item:get_name() == "mobs:nametag"
|
if item:get_name() == "mobs:nametag"
|
||||||
and clicker:get_player_name() == self.owner then
|
and (name == self.owner
|
||||||
|
or minetest.check_player_privs(name, "protection_bypass")) then
|
||||||
local name = clicker:get_player_name()
|
|
||||||
|
|
||||||
-- store mob and nametag stack in external variables
|
-- store mob and nametag stack in external variables
|
||||||
mob_obj[name] = self
|
mob_obj[name] = self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user