mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-09 17:30:21 +01:00
added infotext and mob follows improvements (thx Kazooo)
This commit is contained in:
parent
de0914312c
commit
998637fc3d
9
api.lua
9
api.lua
@ -14,7 +14,7 @@ local use_vh1 = minetest.get_modpath("visual_harm_1ndicators")
|
|||||||
-- Global
|
-- Global
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20240402",
|
version = "20240408",
|
||||||
translate = S,
|
translate = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||||
node_snow = minetest.registered_aliases["mapgen_snow"]
|
node_snow = minetest.registered_aliases["mapgen_snow"]
|
||||||
@ -718,11 +718,12 @@ function mob_class:update_tag(newname)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.infotext = "Health: " .. self.health .. " / " .. prop.hp_max
|
self.infotext = "Entity: " .. self.name .. " | Type: " .. self.type
|
||||||
|
.. ("\nHealth: " .. self.health .. " / " .. prop.hp_max)
|
||||||
.. (self.owner == "" and "" or "\nOwner: " .. self.owner)
|
.. (self.owner == "" and "" or "\nOwner: " .. self.owner)
|
||||||
.. ("\nEntity: " .. self.name)
|
|
||||||
.. text
|
.. text
|
||||||
|
|
||||||
|
|
||||||
-- set infotext changes
|
-- set infotext changes
|
||||||
if self.infotext ~= prop.infotext then
|
if self.infotext ~= prop.infotext then
|
||||||
self.object:set_properties({infotext = self.infotext})
|
self.object:set_properties({infotext = self.infotext})
|
||||||
@ -4856,7 +4857,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
|
|||||||
|
|
||||||
minetest.chat_send_player(clicker:get_player_name(),
|
minetest.chat_send_player(clicker:get_player_name(),
|
||||||
S("@1 follows:",
|
S("@1 follows:",
|
||||||
self.name:split(":")[2]) .. "\n" ..
|
self.name:split(":")[2]) .. "\n- " ..
|
||||||
table.concat(self.follow, "\n- "))
|
table.concat(self.follow, "\n- "))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user