param2.lua 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. -- This file is for misc. param2 tests that aren't covered in drawtypes.lua already.
  2. local S = core.get_translator("testnodes")
  3. core.register_node("testnodes:facedir", {
  4. description = S("Facedir Test Node").."\n"..
  5. S("param2 = facedir rotation (0..23)"),
  6. paramtype2 = "facedir",
  7. tiles = {
  8. "testnodes_1.png",
  9. "testnodes_2.png",
  10. "testnodes_3.png",
  11. "testnodes_4.png",
  12. "testnodes_5.png",
  13. "testnodes_6.png",
  14. },
  15. groups = { dig_immediate = 3 },
  16. })
  17. core.register_node("testnodes:4dir", {
  18. description = S("4dir Test Node").."\n"..
  19. S("param2 = 4dir rotation (0..3)"),
  20. paramtype2 = "4dir",
  21. tiles = {
  22. "testnodes_1f.png",
  23. "testnodes_2f.png",
  24. "testnodes_3f.png",
  25. "testnodes_4f.png",
  26. "testnodes_5f.png",
  27. "testnodes_6f.png",
  28. },
  29. groups = { dig_immediate = 3 },
  30. })
  31. core.register_node("testnodes:facedir_nodebox", {
  32. description = S("Facedir Nodebox Test Node").."\n"..
  33. S("param2 = facedir rotation (0..23)"),
  34. tiles = {
  35. "testnodes_1.png",
  36. "testnodes_2.png",
  37. "testnodes_3.png",
  38. "testnodes_4.png",
  39. "testnodes_5.png",
  40. "testnodes_6.png",
  41. },
  42. drawtype = "nodebox",
  43. paramtype = "light",
  44. paramtype2 = "facedir",
  45. node_box = {
  46. type = "fixed",
  47. fixed = {-0.5, -0.5, -0.5, 0.2, 0.2, 0.2},
  48. },
  49. groups = {dig_immediate=3},
  50. })
  51. core.register_node("testnodes:4dir_nodebox", {
  52. description = S("4dir Nodebox Test Node").."\n"..
  53. S("param2 = 4dir rotation (0..3)"),
  54. tiles = {
  55. "testnodes_1f.png",
  56. "testnodes_2f.png",
  57. "testnodes_3f.png",
  58. "testnodes_4f.png",
  59. "testnodes_5f.png",
  60. "testnodes_6f.png",
  61. },
  62. drawtype = "nodebox",
  63. paramtype = "light",
  64. paramtype2 = "4dir",
  65. node_box = {
  66. type = "fixed",
  67. fixed = {-0.5, -0.5, -0.5, 0.2, 0.2, 0.2},
  68. },
  69. groups = {dig_immediate=3},
  70. })
  71. core.register_node("testnodes:4dir_nodebox_stair", {
  72. description = S("4dir Nodebox Stair Test Node").."\n"..
  73. S("param2 = 4dir rotation (0..3)"),
  74. tiles = {
  75. "testnodes_1f.png",
  76. "testnodes_2f.png",
  77. "testnodes_3f.png",
  78. "testnodes_4f.png",
  79. "testnodes_5f.png",
  80. "testnodes_6f.png",
  81. },
  82. drawtype = "nodebox",
  83. paramtype = "light",
  84. paramtype2 = "4dir",
  85. node_box = {
  86. type = "fixed",
  87. fixed = {
  88. {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  89. {-0.5, 0, 0, 0.5, 0.5, 0.5},
  90. },
  91. },
  92. groups = { dig_immediate = 3 },
  93. })
  94. core.register_node("testnodes:wallmounted", {
  95. description = S("Wallmounted Test Node").."\n"..
  96. S("param2 = wallmounted rotation (0..7)"),
  97. paramtype2 = "wallmounted",
  98. tiles = {
  99. "testnodes_1w.png",
  100. "testnodes_2w.png",
  101. "testnodes_3w.png",
  102. "testnodes_4w.png",
  103. "testnodes_5w.png",
  104. "testnodes_6w.png",
  105. },
  106. groups = { dig_immediate = 3 },
  107. })
  108. core.register_node("testnodes:wallmounted_rot", {
  109. description = S("Wallmounted Rotatable Test Node"),
  110. paramtype2 = "wallmounted",
  111. wallmounted_rotate_vertical = true,
  112. tiles = {
  113. "testnodes_1w.png^[colorize:#FFFF00:40",
  114. "testnodes_2w.png^[colorize:#FFFF00:40",
  115. "testnodes_3w.png^[colorize:#FFFF00:40",
  116. "testnodes_4w.png^[colorize:#FFFF00:40",
  117. "testnodes_5w.png^[colorize:#FFFF00:40",
  118. "testnodes_6w.png^[colorize:#FFFF00:40",
  119. },
  120. groups = { dig_immediate = 3 },
  121. })
  122. core.register_node("testnodes:wallmounted_nodebox", {
  123. description = S("Wallmounted Nodebox Test Node").."\n"..
  124. S("param2 = wallmounted rotation (0..7)"),
  125. paramtype2 = "wallmounted",
  126. paramtype = "light",
  127. tiles = {
  128. "testnodes_1w.png",
  129. "testnodes_2w.png",
  130. "testnodes_3w.png",
  131. "testnodes_4w.png",
  132. "testnodes_5w.png",
  133. "testnodes_6w.png",
  134. },
  135. drawtype = "nodebox",
  136. node_box = {
  137. type = "wallmounted",
  138. wall_top = { -0.5, 0, -0.5, 0.5, 0.5, 0.5 },
  139. wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
  140. wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 },
  141. },
  142. groups = { dig_immediate = 3 },
  143. })
  144. core.register_node("testnodes:wallmounted_nodebox_rot", {
  145. description = S("Wallmounted Rotatable Nodebox Test Node"),
  146. paramtype2 = "wallmounted",
  147. wallmounted_rotate_vertical = true,
  148. paramtype = "light",
  149. tiles = {
  150. "testnodes_1w.png^[colorize:#FFFF00:40",
  151. "testnodes_2w.png^[colorize:#FFFF00:40",
  152. "testnodes_3w.png^[colorize:#FFFF00:40",
  153. "testnodes_4w.png^[colorize:#FFFF00:40",
  154. "testnodes_5w.png^[colorize:#FFFF00:40",
  155. "testnodes_6w.png^[colorize:#FFFF00:40",
  156. },
  157. drawtype = "nodebox",
  158. node_box = {
  159. type = "wallmounted",
  160. wall_top = { -0.5, 0, -0.5, 0.5, 0.5, 0.5 },
  161. wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
  162. wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 },
  163. },
  164. groups = { dig_immediate = 3 },
  165. })
  166. core.register_node("testnodes:color", {
  167. description = S("Color Test Node").."\n"..
  168. S("param2 = color (0..255)"),
  169. paramtype2 = "color",
  170. palette = "testnodes_palette_full.png",
  171. tiles = {
  172. "testnodes_node.png",
  173. },
  174. groups = { dig_immediate = 3 },
  175. })
  176. core.register_node("testnodes:colorfacedir", {
  177. description = S("Color Facedir Test Node").."\n"..
  178. S("param2 = color + facedir rotation (0..23, 32..55, ...)"),
  179. paramtype2 = "colorfacedir",
  180. palette = "testnodes_palette_facedir.png",
  181. tiles = {
  182. "testnodes_1g.png",
  183. "testnodes_2g.png",
  184. "testnodes_3g.png",
  185. "testnodes_4g.png",
  186. "testnodes_5g.png",
  187. "testnodes_6g.png",
  188. },
  189. groups = { dig_immediate = 3 },
  190. })
  191. core.register_node("testnodes:colorfacedir_nodebox", {
  192. description = S("Color Facedir Nodebox Test Node").."\n"..
  193. S("param2 = color + facedir rotation (0..23, 32..55, ...)"),
  194. tiles = {
  195. "testnodes_1g.png",
  196. "testnodes_2g.png",
  197. "testnodes_3g.png",
  198. "testnodes_4g.png",
  199. "testnodes_5g.png",
  200. "testnodes_6g.png",
  201. },
  202. drawtype = "nodebox",
  203. paramtype = "light",
  204. paramtype2 = "colorfacedir",
  205. palette = "testnodes_palette_facedir.png",
  206. node_box = {
  207. type = "fixed",
  208. fixed = {-0.5, -0.5, -0.5, 0.2, 0.2, 0.2},
  209. },
  210. groups = {dig_immediate=3},
  211. })
  212. core.register_node("testnodes:color4dir", {
  213. description = S("Color 4dir Test Node").."\n"..
  214. S("param2 = color + 4dir rotation (0..255)"),
  215. paramtype2 = "color4dir",
  216. palette = "testnodes_palette_4dir.png",
  217. tiles = {
  218. "testnodes_1fg.png",
  219. "testnodes_2fg.png",
  220. "testnodes_3fg.png",
  221. "testnodes_4fg.png",
  222. "testnodes_5fg.png",
  223. "testnodes_6fg.png",
  224. },
  225. groups = { dig_immediate = 3 },
  226. })
  227. core.register_node("testnodes:color4dir_nodebox", {
  228. description = S("Color 4dir Nodebox Test Node").."\n"..
  229. S("param2 = color + 4dir rotation (0..255)"),
  230. tiles = {
  231. "testnodes_1fg.png",
  232. "testnodes_2fg.png",
  233. "testnodes_3fg.png",
  234. "testnodes_4fg.png",
  235. "testnodes_5fg.png",
  236. "testnodes_6fg.png",
  237. },
  238. drawtype = "nodebox",
  239. paramtype = "light",
  240. paramtype2 = "color4dir",
  241. palette = "testnodes_palette_4dir.png",
  242. node_box = {
  243. type = "fixed",
  244. fixed = {-0.5, -0.5, -0.5, 0.2, 0.2, 0.2},
  245. },
  246. groups = {dig_immediate=3},
  247. })
  248. core.register_node("testnodes:colorwallmounted", {
  249. description = S("Color Wallmounted Test Node").."\n"..
  250. S("param2 = color + wallmounted rotation (0..7, 8..15, ...)"),
  251. paramtype2 = "colorwallmounted",
  252. paramtype = "light",
  253. palette = "testnodes_palette_wallmounted.png",
  254. tiles = {
  255. "testnodes_1wg.png",
  256. "testnodes_2wg.png",
  257. "testnodes_3wg.png",
  258. "testnodes_4wg.png",
  259. "testnodes_5wg.png",
  260. "testnodes_6wg.png",
  261. },
  262. groups = { dig_immediate = 3 },
  263. })
  264. core.register_node("testnodes:colorwallmounted_nodebox", {
  265. description = S("Color Wallmounted Nodebox Test Node").."\n"..
  266. S("param2 = color + wallmounted rotation (0..7, 8..15, ...)"),
  267. paramtype2 = "colorwallmounted",
  268. paramtype = "light",
  269. palette = "testnodes_palette_wallmounted.png",
  270. tiles = {
  271. "testnodes_1wg.png",
  272. "testnodes_2wg.png",
  273. "testnodes_3wg.png",
  274. "testnodes_4wg.png",
  275. "testnodes_5wg.png",
  276. "testnodes_6wg.png",
  277. },
  278. drawtype = "nodebox",
  279. node_box = {
  280. type = "wallmounted",
  281. wall_top = { -0.5, 0, -0.5, 0.5, 0.5, 0.5 },
  282. wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
  283. wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 },
  284. },
  285. groups = { dig_immediate = 3 },
  286. })