diff --git a/src/player/mineclonia.lua b/src/player/mineclonia.lua index baa73e3..4758be9 100644 --- a/src/player/mineclonia.lua +++ b/src/player/mineclonia.lua @@ -12,15 +12,15 @@ function papi.get_animation(player) return mcl_player.player_get_animation(player) end -function papi.get_textures(player, textures) - --todo: handle +function papi.get_textures(player) + return player:get_properties().textures end -function papi.set_textures(player, index, texture) - --todo: handle +function papi.set_textures(player, textures) + player:set_properties({textures = textures}) end -function papi.set_animation(player, anim_name, speed) +function papi.set_animation(player, anim_name, speed, _) return mcl_player.player_set_animation(player, anim_name, speed) end diff --git a/src/player/minetest.lua b/src/player/minetest.lua index 265598a..75f4f08 100644 --- a/src/player/minetest.lua +++ b/src/player/minetest.lua @@ -12,12 +12,12 @@ function papi.get_animation(player) return player_api.get_animation(player) end -function papi.get_textures(player, textures) - return player_api.get_textures(player, textures) +function papi.get_textures(player) + return player_api.get_textures(player) end -function papi.set_textures(player, index, texture) - return player_api.set_textures(player, index, texture) +function papi.set_textures(player, texture) + return player_api.set_textures(player, texture) end function papi.set_animation(player, anim_name, speed, loop) diff --git a/src/player/xcompat_agnostic.lua b/src/player/xcompat_agnostic.lua index 35c4507..3a5523e 100644 --- a/src/player/xcompat_agnostic.lua +++ b/src/player/xcompat_agnostic.lua @@ -1,29 +1,41 @@ local papi = {} +local models = {} function papi.register_model(name, def) - --todo: handle + models[name] = def end -function papi.set_model(player, model) - --todo: handle +function papi.set_model(player, model_name) + local model = models[model_name] + + if not model then return end + + player:set_properties({ + mesh = model_name, + textures = model.textures, + visual = "mesh", + visual_size = model.visual_size, + stepheight = model.stepheight + }) end -function papi.get_animation(player) - --todo: handle +function papi.get_animation(_) + --stub to keep from crashing end -function papi.get_textures(player, textures) - --todo: handle +function papi.get_textures(player) + return player:get_properties().textures end -function papi.set_textures(player, index, texture) - --todo: handle +function papi.set_textures(player, textures) + player:set_properties({textures = textures}) end -function papi.set_animation(player, anim_name, speed, loop) - --todo: handle +function papi.set_animation(_, _, _, _) + --stub to keep from crashing end ---todo: handle ignoring animations (maybe metatables?) +--nothing to do here as we have no globalstep .....that we know about anyways +papi.player_attached = {} return papi \ No newline at end of file