init.lua 1.0 KB

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