1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-06-28 14:36:03 +02:00

move deprecated functions from api to compatibility.lua

This commit is contained in:
tenplus1
2025-04-08 08:33:25 +01:00
parent 027620bfa3
commit 99f4fc1768
3 changed files with 31 additions and 35 deletions

View File

@ -10,3 +10,32 @@ function mobs.compatibility_check(self)
if self.floats == 1 then self.floats = true
elseif self.floats == 0 then self.floats = false end
end
-- deprecated functions
function mobs:yaw(entity, yaw, delay)
entity:set_yaw(yaw, delay)
end
function mobs:set_animation(entity, anim)
entity:set_animation(anim)
end
function mobs:line_of_sight(entity, pos1, pos2)
return entity:line_of_sight(pos1, pos2)
end
function mobs:yaw_to_pos(entity, target, rot)
return entity:yaw_to_pos(target, rot)
end
function mobs:register_spawn(name, nodes, max_light, min_light, chance,
active_object_count, max_height, day_toggle)
mobs:spawn_specific(name, nodes, {"air"}, min_light, max_light, 30,
chance, active_object_count, -31000, max_height, day_toggle)
end
function mobs:explosion(pos, radius)
mobs:boom({sounds = {explode = "tnt_explode"}}, pos, radius, radius, "tnt_smoke.png")
end