init.lua 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. -- Minetest 0.4 mod: bones
  2. -- See README.txt for licensing and other information.
  3. bones = bones or {}
  4. local modpath = minetest.get_modpath("bones")
  5. reload.register_file("bones:msg", modpath .. "/message.lua")
  6. reload.register_file("bones:functions", modpath .. "/functions.lua")
  7. reload.register_file("bones:hack", modpath .. "/nohack.lua")
  8. minetest.register_node("bones:bones_type2", {
  9. description = "Bones (Filthy)",
  10. tiles = {
  11. "bones_top.png^[transform2",
  12. "bones_bottom.png",
  13. "bones_side.png",
  14. "bones_side.png",
  15. "bones_rear.png",
  16. "bones_front.png"
  17. },
  18. paramtype2 = "facedir",
  19. groups = utility.dig_groups("bigitem", {
  20. bones = 1,
  21. falling_node = 1,
  22. -- Enables mob bones to burn up in lava eventually.
  23. flammable = 1,
  24. }),
  25. --damage_per_second = 2,
  26. sounds = default.node_sound_gravel_defaults(),
  27. })
  28. minetest.register_node("bones:bones", {
  29. description = "Bones (Filthy)",
  30. tiles = {
  31. "bones_top.png^[transform2",
  32. "bones_bottom.png",
  33. "bones_side.png",
  34. "bones_side.png",
  35. "bones_rear.png",
  36. "bones_front.png"
  37. },
  38. paramtype2 = "facedir",
  39. drop = "bones:bones_type2",
  40. groups = utility.dig_groups("bigitem", {immovable = 1}),
  41. sounds = default.node_sound_gravel_defaults(),
  42. can_dig = function(...) return bones.can_dig(...) end,
  43. allow_metadata_inventory_move = function(...) return bones.allow_metadata_inventory_move(...) end,
  44. allow_metadata_inventory_put = function(...) return bones.allow_metadata_inventory_put(...) end,
  45. allow_metadata_inventory_take = function(...) return bones.allow_metadata_inventory_take(...) end,
  46. on_metadata_inventory_take = function(...) return bones.on_metadata_inventory_take(...) end,
  47. on_punch = function(...) return bones.on_punch(...) end,
  48. on_timer = function(...) return bones.on_timer(...) end,
  49. on_blast = function(...) return bones.on_blast(...) end,
  50. on_destruct = function(...) return bones.on_destruct(...) end,
  51. on_rightclick = function(...) return bones.on_rightclick(...) end,
  52. })
  53. minetest.register_on_dieplayer(function(...) return bones.on_dieplayer(...) end)
  54. minetest.register_on_dieplayer(function(...) return bones.nohack.on_dieplayer(...) end)
  55. minetest.register_on_respawnplayer(function(...) return bones.nohack.on_respawnplayer(...) end)
  56. minetest.register_on_leaveplayer(function(...) return bones.kill_bully_on_leaveplayer(...) end)