init.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. -- Baked Clay by TenPlus1
  2. -- Modified for _Must Test_ server by MustTest
  3. -- Note: must match the colors defined by the 'dye' mod.
  4. local clay = {
  5. {"white", "White"},
  6. {"grey", "Grey"},
  7. {"black", "Black"},
  8. {"red", "Red"},
  9. {"yellow", "Yellow"},
  10. {"green", "Green"},
  11. {"cyan", "Cyan"},
  12. {"blue", "Blue"},
  13. {"magenta", "Magenta"},
  14. {"orange", "Orange"},
  15. {"violet", "Violet"},
  16. {"brown", "Brown"},
  17. {"pink", "Pink"},
  18. {"dark_grey", "Dark Grey"},
  19. {"dark_green", "Dark Green"},
  20. }
  21. for _, clay in ipairs(clay) do
  22. -- node definition
  23. minetest.register_node("bakedclay:" .. clay[1], {
  24. description = clay[2] .. " Baked Clay",
  25. tiles = {"baked_clay_" .. clay[1] ..".png"},
  26. groups = utility.dig_groups("hardclay", {bakedclay = 1}),
  27. sounds = default.node_sound_stone_defaults(),
  28. })
  29. -- craft from dye and white baked clay
  30. minetest.register_craft({
  31. output = "bakedclay:" .. clay[1] .. " 8",
  32. recipe = {
  33. {"bakedclay:white", "bakedclay:white", "bakedclay:white"},
  34. {"bakedclay:white", "dye:" .. clay[1], "bakedclay:white"},
  35. {"bakedclay:white", "bakedclay:white", "bakedclay:white"},
  36. },
  37. })
  38. -- register stair and slab
  39. stairs.register_stair_and_slab(
  40. "bakedclay_".. clay[1],
  41. "bakedclay:".. clay[1],
  42. utility.dig_groups("hardclay"),
  43. {"baked_clay_" .. clay[1] .. ".png"},
  44. clay[2] .. " Baked Clay",
  45. default.node_sound_stone_defaults()
  46. )
  47. end
  48. -- cook clay block into white baked clay
  49. minetest.register_craft({
  50. type = "cooking",
  51. output = "bakedclay:white",
  52. recipe = "default:clay",
  53. })
  54. -- any clay cook back into default clay
  55. minetest.register_craft({
  56. type = "cooking",
  57. output = "default:clay",
  58. recipe = "group:bakedclay",
  59. })
  60. -- register a few extra dye colour options
  61. minetest.register_craft( {
  62. type = "shapeless",
  63. output = "dye:dark_grey 3",
  64. recipe = {"dye:black", "dye:black", "dye:white"}
  65. })
  66. minetest.register_craft( {
  67. type = "shapeless",
  68. output = "dye:grey 3",
  69. recipe = {"dye:black", "dye:white", "dye:white"}
  70. })
  71. minetest.register_craft( {
  72. type = "extracting",
  73. output = "dye:brown 4",
  74. recipe = "default:dry_shrub"
  75. })
  76. -- 2x2 red bakedclay makes 16x clay brick
  77. minetest.register_craft( {
  78. output = "default:clay_brick 16",
  79. recipe = {
  80. {"bakedclay:red", "bakedclay:red"},
  81. {"bakedclay:red", "bakedclay:red"},
  82. }
  83. })
  84. -- register some new flowers to fill in missing dye colours
  85. -- flower registration (borrowed from default game)
  86. local function add_simple_flower(name, desc, box, f_groups)
  87. f_groups.flower = 1
  88. f_groups.flora = 1
  89. f_groups.attached_node = 1
  90. f_groups.flammable = 3,
  91. minetest.register_node(":flowers:" .. name, {
  92. description = desc,
  93. drawtype = "plantlike",
  94. waving = 1,
  95. tiles = {"baked_clay_" .. name .. ".png"},
  96. inventory_image = "baked_clay_" .. name .. ".png",
  97. wield_image = "baked_clay_" .. name .. ".png",
  98. sunlight_propagates = true,
  99. paramtype = "light",
  100. walkable = false,
  101. buildable_to = true,
  102. groups = utility.dig_groups("plant", f_groups),
  103. sounds = default.node_sound_leaves_defaults(),
  104. selection_box = {
  105. type = "fixed",
  106. fixed = box
  107. },
  108. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  109. on_construct = function(...)
  110. return flowers.on_flora_construct(...)
  111. end,
  112. on_destruct = function(...)
  113. return flowers.on_flora_destruct(...)
  114. end,
  115. on_timer = function(...)
  116. return flowers.on_flora_timer(...)
  117. end,
  118. on_punch = function(...)
  119. return flowers.on_flora_punch(...)
  120. end,
  121. })
  122. end
  123. local flowers = {
  124. {"delphinium", "Blue Delphinium", {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16},
  125. {color_cyan = 1}},
  126. {"thistle", "Thistle", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_magenta = 1}},
  127. {"lazarus", "Lazarus Bell", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_pink = 1}},
  128. {"mannagrass", "Reed Mannagrass", {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16},
  129. {color_dark_green = 1}},
  130. {"lockspur", "Lockspur", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_cyan = 1}},
  131. }
  132. for _,item in pairs(flowers) do
  133. add_simple_flower(unpack(item))
  134. end
  135. minetest.register_craft({
  136. type = "extracting",
  137. output = 'dye:cyan 5',
  138. recipe = 'flowers:delphinium',
  139. time = 3,
  140. })
  141. minetest.register_craft({
  142. type = "extracting",
  143. output = 'dye:cyan 5',
  144. recipe = 'flowers:lockspur',
  145. time = 3,
  146. })
  147. minetest.register_craft({
  148. type = "extracting",
  149. output = 'dye:magenta 5',
  150. recipe = 'flowers:thistle',
  151. time = 3,
  152. })
  153. minetest.register_craft({
  154. type = "extracting",
  155. output = 'dye:pink 5',
  156. recipe = 'flowers:lazarus',
  157. time = 3,
  158. })
  159. minetest.register_craft({
  160. type = "extracting",
  161. output = 'dye:dark_green 5',
  162. recipe = 'flowers:mannagrass',
  163. time = 3,
  164. })
  165. minetest.register_craft({
  166. type = "shapeless",
  167. output = "default:clay_lump",
  168. recipe = {"darkage:silt_lump", "darkage:mud_lump"},
  169. })