Fix axolotl heads on 5.11.0

This commit is contained in:
teknomunk 2025-03-02 13:28:24 -06:00 committed by the-real-herowl
parent 3f898917cd
commit e471a29b2d
3 changed files with 5 additions and 1 deletions
mods/ENTITIES

View file

@ -388,7 +388,9 @@ function mob_class:check_head_swivel(dtime)
if self.object.get_bone_override then -- minetest >= 5.9
self.object:set_bone_override(self.head_swivel, {
position = { vec = self.head_bone_position, absolute = true },
rotation = { vec = newr, absolute = true, interpolation = 0.1 } })
rotation = { vec = newr, absolute = true, interpolation = 0.1 },
scale = self.head_scale and { vec = self.head_scale, absolute = true, interpolation = 0.1 } or nil,
})
else -- minetest < 5.9
-- old API uses degrees not radians and absolute positions
self.object:set_bone_position(self.head_swivel, self.head_bone_position, vector.apply(newr, math.deg))

View file

@ -157,6 +157,7 @@ function mcl_mobs.register_mob(name, def)
head_bone_position = def.head_bone_position or { 0, def.bone_eye_height or 1.4, def.horizontal_head_height or 0},
curiosity = def.curiosity or 1, -- how often mob will look at player on idle
head_yaw = def.head_yaw or "y", -- axis to rotate head on
head_scale = def.head_scale,
wears_armor = def.wears_armor, -- a number value used to index texture slot for armor
stepheight = def.stepheight or 0.6,
name = name,

View file

@ -16,6 +16,7 @@ local axolotl = {
head_bone_position = vector.new( 0, -1, 0 ), -- for minetest <= 5.8
curiosity = 10,
head_yaw="z",
head_scale = vector.new(1,-1,-1),
armor = 100,
rotate = 180,