2019-09-11 02:09:51 +09:00
|
|
|
-- player/init.lua
|
|
|
|
|
2017-07-26 19:38:11 +01:00
|
|
|
dofile(minetest.get_modpath("player_api") .. "/api.lua")
|
|
|
|
|
2023-08-13 18:46:01 -04:00
|
|
|
player_api.dynamicmodel(nil)
|
|
|
|
|
2017-07-26 19:38:11 +01:00
|
|
|
-- Default player appearance
|
2023-08-06 12:26:52 -04:00
|
|
|
player_api.register_model(player_api.modelchar, {
|
2017-07-26 19:38:11 +01:00
|
|
|
animation_speed = 30,
|
|
|
|
textures = {"character.png", },
|
|
|
|
animations = {
|
|
|
|
-- Standard animations.
|
2017-08-07 04:27:19 +01:00
|
|
|
stand = {x = 0, y = 79},
|
|
|
|
lay = {x = 162, y = 166},
|
|
|
|
walk = {x = 168, y = 187},
|
|
|
|
mine = {x = 189, y = 198},
|
|
|
|
walk_mine = {x = 200, y = 219},
|
|
|
|
sit = {x = 81, y = 160},
|
2017-07-26 19:38:11 +01:00
|
|
|
},
|
2017-10-27 08:28:22 +01:00
|
|
|
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
|
2017-08-07 04:27:19 +01:00
|
|
|
stepheight = 0.6,
|
2023-08-06 12:26:52 -04:00
|
|
|
eye_height = player_api.eyeheithg,
|
2017-07-26 19:38:11 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
-- Update appearance when the player joins
|
|
|
|
minetest.register_on_joinplayer(function(player)
|
2023-08-13 18:46:01 -04:00
|
|
|
local player_name = player:get_player_name()
|
|
|
|
player_api.dynamicmodel(player_name)
|
|
|
|
player_api.player_attached[player_name] = false
|
2023-08-06 12:26:52 -04:00
|
|
|
player_api.set_model(player, player_api.modelchar)
|
2017-08-07 04:27:19 +01:00
|
|
|
player:set_local_animation(
|
|
|
|
{x = 0, y = 79},
|
|
|
|
{x = 168, y = 187},
|
|
|
|
{x = 189, y = 198},
|
|
|
|
{x = 200, y = 219},
|
|
|
|
30
|
|
|
|
)
|
2017-07-26 19:38:11 +01:00
|
|
|
end)
|