Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
wsor4035 committed Sep 7, 2024
1 parent 9abd19c commit 3d28f3f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/player/mineclonia.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/player/minetest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
36 changes: 24 additions & 12 deletions src/player/xcompat_agnostic.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3d28f3f

Please sign in to comment.