init.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_cyan = 1}},
  125. {"thistle", "Thistle", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_magenta = 1}},
  126. {"lazarus", "Lazarus Bell", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_pink = 1}},
  127. {"mannagrass", "Reed Mannagrass", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_dark_green = 1}},
  128. }
  129. for _,item in pairs(flowers) do
  130. add_simple_flower(unpack(item))
  131. end
  132. minetest.register_craft({
  133. type = "extracting",
  134. output = 'dye:cyan 5',
  135. recipe = 'flowers:delphinium',
  136. time = 3,
  137. })
  138. minetest.register_craft({
  139. type = "extracting",
  140. output = 'dye:magenta 5',
  141. recipe = 'flowers:thistle',
  142. time = 3,
  143. })
  144. minetest.register_craft({
  145. type = "extracting",
  146. output = 'dye:pink 5',
  147. recipe = 'flowers:lazarus',
  148. time = 3,
  149. })
  150. minetest.register_craft({
  151. type = "extracting",
  152. output = 'dye:dark_green 5',
  153. recipe = 'flowers:mannagrass',
  154. time = 3,
  155. })
  156. minetest.register_craft({
  157. type = "shapeless",
  158. output = "default:clay_lump",
  159. recipe = {"darkage:silt_lump", "darkage:mud_lump"},
  160. })