init.lua 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. if not minetest.global_exists("wizard") then wizard = {} end
  2. wizard.modpath = minetest.get_modpath("wizard")
  3. function wizard.on_construct(pos)
  4. end
  5. function wizard.on_destruct(pos)
  6. end
  7. function wizard.on_pre_fall(pos)
  8. end
  9. function wizard.on_blast(pos)
  10. end
  11. function wizard.on_collapse_to_entity(pos, node)
  12. end
  13. function wizard.on_finish_collapse(pos, node)
  14. end
  15. function wizard.on_rightclick(pos, node, user, itemstack, pt)
  16. end
  17. function wizard.allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, user)
  18. end
  19. function wizard.on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, user)
  20. end
  21. function wizard.allow_metadata_inventory_put(pos, listname, index, stack, user)
  22. end
  23. function wizard.on_metadata_inventory_put(pos, listname, index, stack, user)
  24. end
  25. function wizard.allow_metadata_inventory_take(pos, listname, index, stack, user)
  26. end
  27. function wizard.on_metadata_inventory_take(pos, listname, index, stack, user)
  28. end
  29. function wizard.after_place_node(pos, user, itemstack, pt)
  30. end
  31. function wizard.on_punch(pos, node, user, pt)
  32. end
  33. function wizard.on_timer(pos, elapsed)
  34. end
  35. function wizard.can_dig(pos, user)
  36. end
  37. function wizard.on_rotate(pos, node, user, mode, new_param2)
  38. end
  39. if not wizard.registered then
  40. wizard.registered = true
  41. minetest.register_node("wizard:stone", {
  42. description = "Wizard Stone (You Hacker)",
  43. tiles = {"default_obsidian.png"},
  44. on_rotate = function(...) return wizard.on_rotate(...) end,
  45. groups = utility.dig_groups("obsidian", {stone=1, immovable=1}),
  46. drop = "",
  47. sounds = default.node_sound_stone_defaults(),
  48. crushing_damage = 20*500,
  49. node_dig_prediction = "",
  50. on_construct = function(...) return wizard.on_construct(...) end,
  51. on_destruct = function(...) return wizard.on_destruct(...) end,
  52. on_blast = function(...) return wizard.on_blast(...) end,
  53. on_collapse_to_entity = function(...) return wizard.on_collapse_to_entity(...) end,
  54. on_finish_collapse = function(...) return wizard.on_finish_collapse(...) end,
  55. on_rightclick = function(...) return wizard.on_rightclick(...) end,
  56. allow_metadata_inventory_move = function(...) return wizard.allow_metadata_inventory_move(...) end,
  57. allow_metadata_inventory_put = function(...) return wizard.allow_metadata_inventory_put(...) end,
  58. allow_metadata_inventory_take = function(...) return wizard.allow_metadata_inventory_take(...) end,
  59. on_metadata_inventory_move = function(...) return wizard.on_metadata_inventory_move(...) end,
  60. on_metadata_inventory_put = function(...) return wizard.on_metadata_inventory_put(...) end,
  61. on_metadata_inventory_take = function(...) return wizard.on_metadata_inventory_take(...) end,
  62. after_place_node = function(...) return wizard.after_place_node(...) end,
  63. on_punch = function(...) return wizard.on_punch(...) end,
  64. on_timer = function(...) return wizard.on_timer(...) end,
  65. can_dig = function(...) return wizard.can_dig(...) end,
  66. _on_update_infotext = function(...) return wizard.update_infotext(...) end,
  67. _on_update_formspec = function(...) return wizard.update_formspec(...) end,
  68. _on_update_entity = function(...) return wizard.update_entity(...) end,
  69. _on_pre_fall = function(...) return wizard.on_pre_fall(...) end,
  70. })
  71. -- Register mod reloadable.
  72. local c = "wizard:core"
  73. local f = wizard.modpath .. "/init.lua"
  74. reload.register_file(c, f, false)
  75. end