colored_mese.lua 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. local colored_block_modname = "gold_and_gem"
  2. local colored_block_texname = "goldgem"
  3. local colored_block_description = "Mese Block"
  4. local colored_block_sunlight = "false"
  5. local colored_block_walkable = "true"
  6. local colored_block_groups = {cracky=1,level=2, not_in_creative_inventory=1}
  7. local colored_block_sound = "default.node_sound_stone_defaults()"
  8. local shades = {
  9. "dark_",
  10. "medium_",
  11. "" -- represents "no special shade name", e.g. full.
  12. }
  13. local shades2 = {
  14. "Dark ",
  15. "Medium ",
  16. "" -- represents "no special shade name", e.g. full.
  17. }
  18. local hues = {
  19. "red",
  20. "orange",
  21. "yellow",
  22. "lime",
  23. "green",
  24. "aqua",
  25. "cyan",
  26. "skyblue",
  27. "blue",
  28. "violet",
  29. "magenta",
  30. "redviolet"
  31. }
  32. local hues2 = {
  33. "Red ",
  34. "Orange ",
  35. "Yellow ",
  36. "Lime ",
  37. "Green ",
  38. "Aqua ",
  39. "Cyan ",
  40. "Sky Blue ",
  41. "Blue ",
  42. "Violet ",
  43. "Magenta ",
  44. "Red-violet "
  45. }
  46. local greys = {
  47. "black",
  48. "darkgrey",
  49. "grey",
  50. "lightgrey",
  51. "white"
  52. }
  53. local greys2 = {
  54. "Black ",
  55. "Dark Grey ",
  56. "Medium Grey ",
  57. "Light Grey ",
  58. "White "
  59. }
  60. local greys3 = {
  61. "black",
  62. "darkgrey_paint",
  63. "grey",
  64. "lightgrey_paint",
  65. "white_paint"
  66. }
  67. for shade = 1, 3 do
  68. local shadename = shades[shade]
  69. local shadename2 = shades2[shade]
  70. for hue = 1, 12 do
  71. local huename = hues[hue]
  72. local huename2 = hues2[hue]
  73. local colorname = colored_block_modname..":mese_"..shadename..huename
  74. local pngname = colored_block_texname.."_mese_"..shadename..huename..".png"
  75. local nodedesc = shadename2..huename2..colored_block_description
  76. local s50colorname = colored_block_modname..":mese_"..shadename..huename.."_s50"
  77. local s50pngname = colored_block_texname.."_mese_"..shadename..huename.."_s50.png"
  78. local s50nodedesc = shadename2..huename2..colored_block_description.." (50% Saturation)"
  79. minetest.register_node(colorname, {
  80. description = nodedesc,
  81. tiles = { pngname },
  82. sunlight_propagates = colored_block_sunlight,
  83. paramtype = "light",
  84. walkable = colored_block_walkable,
  85. groups = colored_block_groups,
  86. sounds = colored_block_sound,
  87. })
  88. minetest.register_node(s50colorname, {
  89. description = s50nodedesc,
  90. tiles = { s50pngname },
  91. sunlight_propagates = colored_block_sunlight,
  92. paramtype = "light",
  93. walkable = colored_block_walkable,
  94. groups = colored_block_groups,
  95. sounds = colored_block_sound,
  96. })
  97. minetest.register_craft( {
  98. type = "shapeless",
  99. output = colorname.." 1",
  100. recipe = {
  101. "default:mese",
  102. "unifieddyes:"..shadename..huename
  103. },
  104. })
  105. minetest.register_craft( {
  106. type = "shapeless",
  107. output = s50colorname.." 1",
  108. recipe = {
  109. "default:mese",
  110. "unifieddyes:"..shadename..huename.."_s50"
  111. },
  112. })
  113. end
  114. end
  115. for hue = 1, 12 do
  116. local huename = hues[hue]
  117. local huename2 = hues2[hue]
  118. local colorname = colored_block_modname..":mese_light_"..huename
  119. local pngname = colored_block_texname.."_mese_light_"..huename..".png"
  120. local nodedesc = "Light "..huename2..colored_block_description
  121. minetest.register_node(colorname, {
  122. description = nodedesc,
  123. tiles = { pngname },
  124. sunlight_propagates = colored_block_sunlight,
  125. paramtype = "light",
  126. walkable = colored_block_walkable,
  127. groups = colored_block_groups,
  128. sounds = colored_block_sound,
  129. })
  130. minetest.register_craft( {
  131. type = "shapeless",
  132. output = colorname.." 1",
  133. recipe = {
  134. "default:mese",
  135. "unifieddyes:".."light_"..huename
  136. },
  137. })
  138. end
  139. minetest.register_node(colored_block_modname..":mese_brown", {
  140. description = "Brown "..colored_block_description,
  141. tiles = { "goldgem_mese_brown.png" },
  142. sunlight_propagates = colored_block_sunlight,
  143. paramtype = "light",
  144. walkable = colored_block_walkable,
  145. groups = colored_block_groups,
  146. sounds = colored_block_sound,
  147. })
  148. minetest.register_craft( {
  149. type = "shapeless",
  150. output = colored_block_modname..":mese_brown 1",
  151. recipe = {
  152. "default:mese",
  153. "dye:brown"
  154. },
  155. })
  156. for grey = 1,5 do
  157. local greyname = greys[grey]
  158. local greyname2 = greys2[grey]
  159. local greyname3 = greys3[grey]
  160. local greyshadename = colored_block_modname..":mese_"..greyname
  161. local pngname = colored_block_texname.."_mese_"..greyname..".png"
  162. local nodedesc = greyname2..colored_block_description
  163. minetest.register_node(greyshadename, {
  164. description = nodedesc,
  165. tiles = { pngname },
  166. sunlight_propagates = colored_block_sunlight,
  167. paramtype = "light",
  168. walkable = colored_block_walkable,
  169. groups = colored_block_groups,
  170. sounds = colored_block_sound,
  171. })
  172. if grey == 1 or grey == 3 then
  173. minetest.register_craft( {
  174. type = "shapeless",
  175. output = greyshadename.." 1",
  176. recipe = {
  177. "default:mese",
  178. "dye:"..greyname3
  179. },
  180. })
  181. else
  182. minetest.register_craft( {
  183. type = "shapeless",
  184. output = greyshadename.." 1",
  185. recipe = {
  186. "default:mese",
  187. "unifieddyes:"..greyname3
  188. },
  189. })
  190. end
  191. end
  192. if not minetest.get_modpath("technic") then
  193. minetest.register_craft( {
  194. type = "cooking",
  195. output = "gold_and_gem:rainbow_dye 3",
  196. recipe = "gold_and_gem:rainbow_mese_block"
  197. })
  198. else
  199. local recipes = {
  200. {"gold_and_gem:rainbow_mese_block", "gold_and_gem:rainbow_dye 3"},
  201. }
  202. for _, data in pairs(recipes) do
  203. technic.register_grinder_recipe({input = {data[1]}, output = data[2]})
  204. end
  205. end
  206. minetest.register_node("gold_and_gem:rainbow_mese_block", {
  207. description = "Rainbow Mese Block",
  208. tiles = { "goldgem_rainbow_mese_block.png" },
  209. sunlight_propagates = "false",
  210. paramtype = "light",
  211. walkable = "true",
  212. groups = {cracky=1,level=2},
  213. sounds = "default.node_sound_stone_defaults()",
  214. })
  215. minetest.register_craft( {
  216. type = "shapeless",
  217. output = "gold_and_gem:rainbow_mese_block 8",
  218. recipe = {
  219. "gold_and_gem:mese_red",
  220. "gold_and_gem:mese_orange",
  221. "default:mese",
  222. "gold_and_gem:mese_green",
  223. "gold_and_gem:mese_aqua",
  224. "gold_and_gem:mese_cyan",
  225. "gold_and_gem:mese_blue",
  226. "gold_and_gem:mese_magenta",
  227. "default:glass"
  228. },
  229. })
  230. minetest.register_craftitem("gold_and_gem:rainbow_dye", {
  231. description = "Mese Rainbow dye",
  232. inventory_image = "goldgem_rainbow_dye.png",
  233. })
  234. minetest.register_craftitem("gold_and_gem:raw_nyan_cat", {
  235. description = "Raw Nyan Cat",
  236. inventory_image = "goldgem_nc_raw.png",
  237. })
  238. minetest.register_craftitem("gold_and_gem:raw_nyan_cat_rainbow", {
  239. description = "Raw Nyan Cat Rainbow",
  240. inventory_image = "goldgem_nc_rb_raw.png",
  241. })
  242. minetest.register_craft( {
  243. output = "gold_and_gem:raw_nyan_cat",
  244. recipe = {
  245. {"dye:magenta", "farming:flour", "dye:violet"},
  246. {"gold_and_gem:rainbow_dye", "gold_and_gem:rainbow_dye", "gold_and_gem:rainbow_dye"},
  247. {"dye:violet", "farming:flour", "dye:magenta" },
  248. },
  249. })
  250. minetest.register_craft( {
  251. type = "cooking",
  252. output = "default:nyancat",
  253. recipe = "gold_and_gem:raw_nyan_cat"
  254. })
  255. minetest.register_craft( {
  256. output = "gold_and_gem:raw_nyan_cat_rainbow",
  257. recipe = {
  258. {"gold_and_gem:rainbow_dye", "gold_and_gem:rainbow_dye", "gold_and_gem:rainbow_dye"},
  259. {"gold_and_gem:rainbow_mese_block", "default:nyancat", "gold_and_gem:rainbow_mese_block"},
  260. {"gold_and_gem:rainbow_dye", "gold_and_gem:rainbow_dye", "gold_and_gem:rainbow_dye" },
  261. },
  262. })
  263. minetest.register_craft( {
  264. type = "cooking",
  265. output = "default:nyancat_rainbow",
  266. recipe = "gold_and_gem:raw_nyan_cat_rainbow"
  267. })