]> git.lizzy.rs Git - Crafter.git/blob - mods/player_api/init.lua
Add in flying pigs
[Crafter.git] / mods / player_api / init.lua
1 -- player/init.lua
2
3 dofile(minetest.get_modpath("player_api") .. "/api.lua")
4
5 -- Default player appearance
6 player_api.register_model("character.b3d", {
7         animation_speed = 24,
8         textures = {"player.png", },
9         animations = {
10                 -- Standard animations.
11                 stand     = {x = 0,   y = 0},
12                 die       = {x = 0,   y = 0},
13                 lay       = {x = 162, y = 162},
14                 walk      = {x = 168, y = 187},
15                 mine      = {x = 189, y = 198},
16                 run       = {x = 189, y = 198},
17                 walk_mine = {x = 200, y = 219},
18                 run_mine  = {x = 200, y = 219},
19                 sit       = {x = 81,  y = 160},
20                 sneak     = {x = 60,  y = 60},
21                 sneak_mine_stand = {x=20,y=30},
22                 sneak_walk= {x = 60,   y = 80},
23                 sneak_mine_walk= {x = 40,   y = 59},
24         },
25         collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
26         stepheight = 0.6,
27         eye_height = 1.47,
28 })
29
30 -- Update appearance when the player joins
31 minetest.register_on_joinplayer(function(player)
32         player_api.player_attached[player:get_player_name()] = false
33         player_api.set_model(player, "character.b3d")
34         player:set_local_animation(
35                 {x = 0,   y = 79},
36                 {x = 168, y = 187},
37                 {x = 189, y = 198},
38                 {x = 200, y = 219},
39                 24
40         )
41 end)
42
43