init.lua 972 B

1234567891011121314151617181920212223242526272829303132333435
  1. dofile(minetest.get_modpath("player_api") .. "/api.lua")
  2. -- Default player appearance
  3. player_api.register_model("character.b3d", {
  4. animation_speed = 30,
  5. textures = {"character.png", },
  6. animations = {
  7. -- Standard animations.
  8. stand = {x = 0, y = 79},
  9. lay = {x = 162, y = 166},
  10. walk = {x = 168, y = 187},
  11. mine = {x = 189, y = 198},
  12. walk_mine = {x = 200, y = 219},
  13. sit = {x = 81, y = 160},
  14. },
  15. collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3},
  16. stepheight = 0.6,
  17. eye_height = 1.47,
  18. })
  19. -- Update appearance when the player joins
  20. minetest.register_on_joinplayer(function(player)
  21. player_api.player_attached[player:get_player_name()] = false
  22. player_api.set_model(player, "character.b3d")
  23. player:set_local_animation(
  24. {x = 0, y = 79},
  25. {x = 168, y = 187},
  26. {x = 189, y = 198},
  27. {x = 200, y = 219},
  28. 30
  29. )
  30. player:hud_set_hotbar_image("gui_hotbar.png")
  31. player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
  32. end)