backport initial properties future use
This commit is contained in:
parent
c02fdfe5f0
commit
f0fe65ec50
26
api.lua
26
api.lua
@ -33,7 +33,7 @@ local use_mc2 = minetest.get_modpath("mcl_core")
|
|||||||
-- Global
|
-- Global
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20230927",
|
version = "20230930",
|
||||||
translate = S, intllib = S,
|
translate = S, intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||||
node_ice = "default:ice",
|
node_ice = "default:ice",
|
||||||
@ -2000,8 +2000,7 @@ local function is_peaceful_player(player)
|
|||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
|
|
||||||
-- player priv enabled
|
-- player priv enabled
|
||||||
if player_name
|
if player_name and minetest.check_player_privs(player_name, "peaceful_player") then
|
||||||
and minetest.check_player_privs(player_name, "peaceful_player") then
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -3238,6 +3237,27 @@ function mob_class:mob_staticdata()
|
|||||||
self.serialized_cmi_components = cmi.serialize_components(self._cmi_components)
|
self.serialized_cmi_components = cmi.serialize_components(self._cmi_components)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- move existing variables to new initial_properties table for future compatibility
|
||||||
|
if not self.initial_properties then
|
||||||
|
|
||||||
|
self.initial_properties = {
|
||||||
|
hp_max = self.hp_max,
|
||||||
|
physical = self.physical,
|
||||||
|
collisionbox = self.collisionbox,
|
||||||
|
selectionbox = self.selectionbox,
|
||||||
|
visual = self.visual,
|
||||||
|
visual_size = self.visual_size,
|
||||||
|
mesh = self.mesh,
|
||||||
|
textures = self.textures,
|
||||||
|
make_footstep_sound = self.make_footstep_sound,
|
||||||
|
stepheight = self.stepheight,
|
||||||
|
glow = self.glow,
|
||||||
|
nametag = self.nametag,
|
||||||
|
damage_texture_modifier = self.damage_texture_modifier,
|
||||||
|
infotext = self.infotext
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
return minetest.serialize(clean_staticdata(self))
|
return minetest.serialize(clean_staticdata(self))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user