diff options
| author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-07-18 13:53:15 +0200 |
|---|---|---|
| committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-07-18 13:53:15 +0200 |
| commit | ffe3c2ae0db6fed0f2b08b71bfa69f3d3df3bb1f (patch) | |
| tree | cc7d9f74a43215c5d8e3965a2bfc2aea5867a7a0 /games/devtest/mods/player_api/init.lua | |
| parent | 45aa2516b2fc675df7049bc9ed713600c95b6423 (diff) | |
| parent | 82731d0d3d8bfe9e56f89466991f13c037f3a61e (diff) | |
| download | dragonfireclient-ffe3c2ae0db6fed0f2b08b71bfa69f3d3df3bb1f.tar.xz | |
Update to minetest 5.4.0-dev
Diffstat (limited to 'games/devtest/mods/player_api/init.lua')
| -rw-r--r-- | games/devtest/mods/player_api/init.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/games/devtest/mods/player_api/init.lua b/games/devtest/mods/player_api/init.lua new file mode 100644 index 000000000..19028de18 --- /dev/null +++ b/games/devtest/mods/player_api/init.lua @@ -0,0 +1,34 @@ +-- player/init.lua + +dofile(minetest.get_modpath("player_api") .. "/api.lua") + +-- Default player appearance +player_api.register_model("character.b3d", { + animation_speed = 30, + textures = {"character.png", }, + animations = { + -- Standard animations. + 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}, + }, + collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, + stepheight = 0.6, + eye_height = 1.47, +}) + +-- Update appearance when the player joins +minetest.register_on_joinplayer(function(player) + player_api.player_attached[player:get_player_name()] = false + player_api.set_model(player, "character.b3d") + player:set_local_animation( + {x = 0, y = 79}, + {x = 168, y = 187}, + {x = 189, y = 198}, + {x = 200, y = 219}, + 30 + ) +end) |
