init.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. converter = converter or {}
  2. converter.modpath = minetest.get_modpath("converter")
  3. dofile(converter.modpath .. "/functions.lua")
  4. if not converter.run_once then
  5. minetest.register_node("converter:converter", {
  6. description = "Supply Converter",
  7. tiles = {
  8. "converter_top.png", "converter_top.png",
  9. "converter_side.png", "converter_side.png",
  10. "converter_side.png", "converter_side.png",
  11. },
  12. groups = utility.dig_groups("machine", {
  13. immovable = 1,
  14. tier_lv = 1, tier_mv = 1, tier_hv = 1,
  15. }),
  16. drop = "conv2:converter",
  17. paramtype2 = "facedir",
  18. on_rotate = function(...) return screwdriver.rotate_simple(...) end,
  19. is_ground_content = false,
  20. sounds = default.node_sound_metal_defaults(),
  21. on_punch = function(...)
  22. return converter.on_punch(...) end,
  23. can_dig = function(...)
  24. return converter.can_dig(...) end,
  25. on_timer = function(...)
  26. return converter.on_timer(...) end,
  27. on_construct = function(...)
  28. return converter.on_construct(...) end,
  29. after_place_node = function(...)
  30. return converter.after_place_node(...) end,
  31. on_metadata_inventory_move = function(...)
  32. return converter.on_metadata_inventory_move(...) end,
  33. on_metadata_inventory_put = function(...)
  34. return converter.on_metadata_inventory_put(...) end,
  35. on_metadata_inventory_take = function(...)
  36. return converter.on_metadata_inventory_take(...) end,
  37. on_blast = function(...)
  38. return converter.on_blast(...) end,
  39. on_destruct = function(...)
  40. return converter.on_destruct(...) end,
  41. allow_metadata_inventory_put = function(...)
  42. return converter.allow_metadata_inventory_put(...) end,
  43. allow_metadata_inventory_move = function(...)
  44. return converter.allow_metadata_inventory_move(...) end,
  45. allow_metadata_inventory_take = function(...)
  46. return converter.allow_metadata_inventory_take(...) end,
  47. on_machine_execute = function(...)
  48. return converter.on_machine_execute(...) end,
  49. })
  50. minetest.register_craft({
  51. output = 'conv2:converter',
  52. recipe = {
  53. {'rubber:rubber_fiber', 'transformer:hv', 'rubber:rubber_fiber'},
  54. {'transformer:mv', 'techcrafts:machine_casing', 'transformer:lv'},
  55. {'cb2:mv', 'cb2:hv', 'cb2:lv'},
  56. }
  57. })
  58. local c = "converter:core"
  59. local f = converter.modpath .. "/init.lua"
  60. reload.register_file(c, f, false)
  61. dofile(converter.modpath .. "/conv2.lua")
  62. converter.run_once = true
  63. end