init.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. local settings = Settings(minetest.get_modpath("quartz").."/settings.txt")
  2. -- internationalization boilerplate
  3. local MP = minetest.get_modpath(minetest.get_current_modname())
  4. local S, NS = dofile(MP.."/intllib.lua")
  5. --
  6. -- Item Registration
  7. --
  8. -- Quartz Crystal
  9. minetest.register_craftitem("quartz:quartz_crystal", {
  10. description = S("Quartz Crystal"),
  11. inventory_image = "quartz_crystal_full.png",
  12. })
  13. minetest.register_craftitem("quartz:quartz_crystal_piece", {
  14. description = S("Quartz Crystal Piece"),
  15. inventory_image = "quartz_crystal_piece.png",
  16. })
  17. --
  18. -- Node Registration
  19. --
  20. -- Ore
  21. minetest.register_node("quartz:quartz_ore", {
  22. description = S("Quartz Ore"),
  23. tiles = {"default_desert_stone.png^quartz_ore.png"},
  24. groups = {cracky=3, stone=1},
  25. drop = 'quartz:quartz_crystal',
  26. sounds = default.node_sound_stone_defaults(),
  27. })
  28. minetest.register_ore({
  29. ore_type = "scatter",
  30. ore = "quartz:quartz_ore",
  31. wherein = "default:desert_stone",
  32. clust_scarcity = 10*10*10,
  33. clust_num_ores = 6,
  34. clust_size = 5,
  35. y_min = -31000,
  36. y_max = -5,
  37. })
  38. -- Quartz Block
  39. minetest.register_node("quartz:block", {
  40. description = S("Quartz Block"),
  41. tiles = {"quartz_block.png"},
  42. groups = {cracky=3, oddly_breakable_by_hand=1},
  43. sounds = default.node_sound_glass_defaults(),
  44. })
  45. -- Chiseled Quartz
  46. minetest.register_node("quartz:chiseled", {
  47. description = S("Chiseled Quartz"),
  48. tiles = {"quartz_chiseled.png"},
  49. groups = {cracky=3, oddly_breakable_by_hand=1},
  50. sounds = default.node_sound_glass_defaults(),
  51. })
  52. -- Quartz Pillar
  53. minetest.register_node("quartz:pillar", {
  54. description = S("Quartz Pillar"),
  55. paramtype2 = "facedir",
  56. tiles = {"quartz_pillar_top.png", "quartz_pillar_top.png",
  57. "quartz_pillar_side.png"},
  58. groups = {cracky=3, oddly_breakable_by_hand=1},
  59. sounds = default.node_sound_glass_defaults(),
  60. on_place = minetest.rotate_node
  61. })
  62. -- Stairs & Slabs
  63. stairs.register_stair_and_slab("quartzblock", "quartz:block",
  64. {cracky=3, oddly_breakable_by_hand=1},
  65. {"quartz_block.png"},
  66. S("Quartz stair"),
  67. S("Quartz slab"),
  68. default.node_sound_glass_defaults())
  69. stairs.register_stair_and_slab("quartzstair", "quartz:pillar",
  70. {cracky=3, oddly_breakable_by_hand=1},
  71. {"quartz_pillar_top.png", "quartz_pillar_top.png",
  72. "quartz_pillar_side.png"},
  73. S("Quartz Pillar stair"),
  74. S("Quartz Pillar slab"),
  75. default.node_sound_glass_defaults())
  76. --
  77. -- Crafting
  78. --
  79. -- Quartz Crystal Piece
  80. minetest.register_craft({
  81. output = '"quartz:quartz_crystal_piece" 3',
  82. recipe = {
  83. {'quartz:quartz_crystal'}
  84. }
  85. })
  86. -- Quartz Block
  87. minetest.register_craft({
  88. output = '"quartz:block" 4',
  89. recipe = {
  90. {'quartz:quartz_crystal', 'quartz:quartz_crystal', ''},
  91. {'quartz:quartz_crystal', 'quartz:quartz_crystal', ''},
  92. {'', '', ''}
  93. }
  94. })
  95. -- Chiseled Quartz
  96. minetest.register_craft({
  97. output = 'quartz:chiseled 4',
  98. recipe = {
  99. {'quartz:block', 'quartz:block', ''},
  100. {'quartz:block', 'quartz:block', ''},
  101. {'', '', ''},
  102. }
  103. })
  104. -- Quartz Pillar
  105. minetest.register_craft({
  106. output = 'quartz:pillar 2',
  107. recipe = {
  108. {'quartz:block', '', ''},
  109. {'quartz:block', '', ''},
  110. {'', '', ''},
  111. }
  112. })