nodes.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. local vert1 = {
  2. type = "fixed",
  3. fixed = {
  4. {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
  5. {0.1875, -0.5, -0.5, 0.5, 0.5, 0.5},
  6. {-0.5, -0.5, -0.5, -0.1875, 0.5, 0.5},
  7. }
  8. }
  9. local vert2 = {
  10. type = "fixed",
  11. fixed = {
  12. {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
  13. {0.1875, -0.5, -0.5, 0.5, 0.5, 0.5},
  14. {-0.5, -0.5, -0.5, -0.1875, 0.5, 0.5},
  15. }
  16. }
  17. local vert3 = {
  18. type = "fixed",
  19. fixed = {
  20. {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
  21. {0.1875, -0.5, -0.5, 0.5, 0.5, 0.5},
  22. {-0.5, -0.5, -0.5, -0.1875, 0.5, 0.5},
  23. }
  24. }
  25. local vert4 = {
  26. type = "fixed",
  27. fixed = {
  28. {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
  29. {0.1875, -0.5, -0.5, 0.5, 0.5, 0.5},
  30. {-0.5, -0.5, -0.5, -0.1875, 0.5, 0.5},
  31. }
  32. }
  33. local hori1 = {
  34. type = "fixed",
  35. fixed = {
  36. {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
  37. {-0.5, 0.1875, -0.5, 0.5, 0.5, 0.5},
  38. {-0.5, -0.5, -0.5, 0.5, -0.1875, 0.5},
  39. }
  40. }
  41. local hori2 = {
  42. type = "fixed",
  43. fixed = {
  44. {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
  45. {-0.5, 0.1875, -0.5, 0.5, 0.5, 0.5},
  46. {-0.5, -0.5, -0.5, 0.5, -0.1875, 0.5},
  47. }
  48. }
  49. local hori3 = {
  50. type = "fixed",
  51. fixed = {
  52. {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
  53. {-0.5, 0.1875, -0.5, 0.5, 0.5, 0.5},
  54. {-0.5, -0.5, -0.5, 0.5, -0.1875, 0.5},
  55. }
  56. }
  57. local hori4 = {
  58. type = "fixed",
  59. fixed = {
  60. {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
  61. {-0.5, 0.1875, -0.5, 0.5, 0.5, 0.5},
  62. {-0.5, -0.5, -0.5, 0.5, -0.1875, 0.5},
  63. }
  64. }
  65. local cross1 = {
  66. type = "fixed",
  67. fixed = {
  68. {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
  69. {0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
  70. {-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
  71. {-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
  72. {0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
  73. }
  74. }
  75. local cross2 = {
  76. type = "fixed",
  77. fixed = {
  78. {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
  79. {0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
  80. {-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
  81. {-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
  82. {0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
  83. }
  84. }
  85. local cross3 = {
  86. type = "fixed",
  87. fixed = {
  88. {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
  89. {0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
  90. {-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
  91. {-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
  92. {0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
  93. }
  94. }
  95. local cross4 = {
  96. type = "fixed",
  97. fixed = {
  98. {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
  99. {0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
  100. {-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
  101. {-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
  102. {0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
  103. }
  104. }
  105. local chis1 = {
  106. type = "fixed",
  107. fixed = {
  108. {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
  109. {-0.4375, -0.4375, -0.5, 0.4375, 0.4375, 0.5},
  110. }
  111. }
  112. local chis2 = {
  113. type = "fixed",
  114. fixed = {
  115. {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
  116. {-0.375, -0.375, -0.5, 0.375, 0.375, 0.5},
  117. {-0.4375, -0.4375, -0.4375, 0.4375, 0.4375, 0.5},
  118. }
  119. }
  120. local chis3 = {
  121. type = "fixed",
  122. fixed = {
  123. {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
  124. {-0.375, -0.375, -0.4375, 0.375, 0.375, 0.5},
  125. {-0.4375, -0.4375, -0.375, 0.4375, 0.4375, 0.5},
  126. {-0.3125, -0.3125, -0.5, 0.3125, 0.3125, 0.5},
  127. }
  128. }
  129. local chis4 = {
  130. type = "fixed",
  131. fixed = {
  132. {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
  133. {-0.375, -0.375, -0.375, 0.375, 0.375, 0.5},
  134. {-0.4375, -0.4375, -0.3125, 0.4375, 0.4375, 0.5},
  135. {-0.3125, -0.3125, -0.4375, 0.3125, 0.3125, 0.5},
  136. {-0.25, -0.25, -0.5, 0.25, 0.25, 0.5},
  137. }
  138. }
  139. local squar1 = {
  140. type = "fixed",
  141. fixed = {
  142. {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
  143. {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.4375},
  144. {0.3125, -0.5, -0.5, 0.5, 0.5, -0.4375},
  145. {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.4375},
  146. {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.4375},
  147. }
  148. }
  149. local squar2 = {
  150. type = "fixed",
  151. fixed = {
  152. {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
  153. {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.375},
  154. {0.3125, -0.5, -0.5, 0.5, 0.5, -0.375},
  155. {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.375},
  156. {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.375},
  157. }
  158. }
  159. local squar3 = {
  160. type = "fixed",
  161. fixed = {
  162. {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
  163. {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
  164. {0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
  165. {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.3125},
  166. {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.3125},
  167. }
  168. }
  169. local squar4 = {
  170. type = "fixed",
  171. fixed = {
  172. {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
  173. {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.25},
  174. {0.3125, -0.5, -0.5, 0.5, 0.5, -0.25},
  175. {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.25},
  176. {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.25},
  177. }
  178. }
  179. local default_material = {
  180. {"default:cobble", "default_cobble", "Cobble", {cracky = 3, not_in_creative_inventory=1}},
  181. {"default:sandstone","default_sandstone", "Sandstone", {crumbly=2, not_in_creative_inventory=1}},
  182. {"default:clay","default_clay", "Clay", {crumbly=3, not_in_creative_inventory=1}},
  183. {"default:coalblock","default_coal_block", "Coal Block", {cracky = 3, not_in_creative_inventory=1}},
  184. {"default:stone","default_stone", "Stone", {cracky = 3, not_in_creative_inventory=1}},
  185. {"default:desert_stone","default_desert_stone", "Desert Stone", {cracky = 3, not_in_creative_inventory=1}},
  186. {"default:wood","default_wood", "Wood", {choppy=2, not_in_creative_inventory=1}},
  187. {"default:acacia_wood","default_acacia_wood", "Acacia Wood", {choppy=2, not_in_creative_inventory=1}},
  188. {"default:aspen_wood","default_aspen_wood", "Aspen Wood", {choppy=2, not_in_creative_inventory=1}},
  189. {"default:pine_wood","default_pine_wood", "Pine Wood", {choppy=2, not_in_creative_inventory=1}},
  190. {"default:desert_cobble","default_desert_cobble", "Desert Cobble", {cracky = 3, not_in_creative_inventory=1}},
  191. {"default:junglewood","default_junglewood", "Jungle Wood", {choppy=2, not_in_creative_inventory=1}},
  192. {"default:sandstonebrick","default_sandstone_brick", "Sandstone Brick", {cracky = 2, not_in_creative_inventory=1}},
  193. {"default:stonebrick","default_stone_brick", "Stone Brick", {cracky = 2, not_in_creative_inventory=1}},
  194. {"default:desert_stonebrick","default_desert_stone_brick", "Desert Stone Brick", {cracky = 2, not_in_creative_inventory=1}},
  195. }
  196. for i in ipairs (default_material) do
  197. local item = default_material [i][1]
  198. local mat = default_material [i][2]
  199. local desc = default_material [i][3]
  200. local gro = default_material [i][4]
  201. minetest.register_node("mychisel:vertical_"..mat.."1", {
  202. description = "Vertical "..desc.."1",
  203. drawtype = "nodebox",
  204. tiles = {
  205. mat..".png",
  206. mat..".png",
  207. mat..".png",
  208. mat..".png",
  209. mat..".png",
  210. mat..".png^mychisel_vtint.png",
  211. },
  212. paramtype = "light",
  213. paramtype2 = "facedir",
  214. drop = item,
  215. groups = gro,
  216. node_box = vert1,
  217. selection_box = vert1,
  218. on_place = minetest.rotate_node,
  219. })
  220. minetest.register_node("mychisel:vertical_"..mat.."2", {
  221. description = "Vertical "..desc.."2",
  222. drawtype = "nodebox",
  223. tiles = {
  224. mat..".png",
  225. mat..".png",
  226. mat..".png",
  227. mat..".png",
  228. mat..".png",
  229. mat..".png^mychisel_vtint.png",
  230. },
  231. paramtype = "light",
  232. paramtype2 = "facedir",
  233. drop = item,
  234. groups = gro,
  235. node_box = vert2,
  236. selection_box = vert2
  237. })
  238. minetest.register_node("mychisel:vertical_"..mat.."3", {
  239. description = "Vertical "..desc.."3",
  240. drawtype = "nodebox",
  241. tiles = {
  242. mat..".png",
  243. mat..".png",
  244. mat..".png",
  245. mat..".png",
  246. mat..".png",
  247. mat..".png^mychisel_vtint.png",
  248. },
  249. paramtype = "light",
  250. paramtype2 = "facedir",
  251. drop = item,
  252. groups = gro,
  253. node_box = vert3,
  254. selection_box = vert3
  255. })
  256. minetest.register_node("mychisel:vertical_"..mat.."4", {
  257. description = "Vertical "..desc.."4",
  258. drawtype = "nodebox",
  259. tiles = {
  260. mat..".png",
  261. mat..".png",
  262. mat..".png",
  263. mat..".png",
  264. mat..".png",
  265. mat..".png^mychisel_vtint.png",
  266. },
  267. paramtype = "light",
  268. paramtype2 = "facedir",
  269. drop = item,
  270. groups = gro,
  271. node_box = vert4,
  272. selection_box = vert4
  273. })
  274. minetest.register_node("mychisel:chiseled_"..mat.."1", {
  275. description = "Chiseled"..desc.."1",
  276. drawtype = "nodebox",
  277. tiles = {
  278. mat..".png",
  279. mat..".png",
  280. mat..".png",
  281. mat..".png",
  282. mat..".png",
  283. mat..".png^mychisel_ctint1.png",
  284. },
  285. paramtype = "light",
  286. paramtype2 = "facedir",
  287. drop = item,
  288. groups = gro,
  289. node_box = chis1,
  290. selection_box = chis1,
  291. })
  292. minetest.register_node("mychisel:chiseled_"..mat.."2", {
  293. description = "Chiseled"..desc.."2",
  294. drawtype = "nodebox",
  295. tiles = {
  296. mat..".png",
  297. mat..".png",
  298. mat..".png",
  299. mat..".png",
  300. mat..".png",
  301. mat..".png^mychisel_ctint2.png",
  302. },
  303. paramtype = "light",
  304. paramtype2 = "facedir",
  305. drop = item,
  306. groups = gro,
  307. node_box = chis2,
  308. selection_box = chis2
  309. })
  310. minetest.register_node("mychisel:chiseled_"..mat.."3", {
  311. description = "Chiseled"..desc.."3",
  312. drawtype = "nodebox",
  313. tiles = {
  314. mat..".png",
  315. mat..".png",
  316. mat..".png",
  317. mat..".png",
  318. mat..".png",
  319. mat..".png^mychisel_ctint3.png",
  320. },
  321. paramtype = "light",
  322. paramtype2 = "facedir",
  323. drop = item,
  324. groups = gro,
  325. node_box = chis3,
  326. selection_box = chis3
  327. })
  328. minetest.register_node("mychisel:chiseled_"..mat.."4", {
  329. description = "Chiseled"..desc.."4",
  330. drawtype = "nodebox",
  331. tiles = {
  332. mat..".png",
  333. mat..".png",
  334. mat..".png",
  335. mat..".png",
  336. mat..".png",
  337. mat..".png^mychisel_ctint4.png",
  338. },
  339. paramtype = "light",
  340. paramtype2 = "facedir",
  341. drop = item,
  342. groups = gro,
  343. node_box = chis4,
  344. selection_box = chis4
  345. })
  346. minetest.register_node("mychisel:horizontal_"..mat.."1", {
  347. description = "Horizontal "..desc.."1",
  348. drawtype = "nodebox",
  349. tiles = {
  350. mat..".png",
  351. mat..".png",
  352. mat..".png",
  353. mat..".png",
  354. mat..".png",
  355. mat..".png^mychisel_htint.png",
  356. },
  357. paramtype = "light",
  358. paramtype2 = "facedir",
  359. drop = item,
  360. groups = gro,
  361. node_box = hori1,
  362. selection_box = hori1
  363. })
  364. minetest.register_node("mychisel:horizontal_"..mat.."2", {
  365. description = "Horizontal"..desc.."2",
  366. drawtype = "nodebox",
  367. tiles = {
  368. mat..".png",
  369. mat..".png",
  370. mat..".png",
  371. mat..".png",
  372. mat..".png",
  373. mat..".png^mychisel_htint.png",
  374. },
  375. paramtype = "light",
  376. paramtype2 = "facedir",
  377. drop = item,
  378. groups = gro,
  379. node_box = hori2,
  380. selection_box = hori2
  381. })
  382. minetest.register_node("mychisel:horizontal_"..mat.."3", {
  383. description = "Horizontal"..desc.."3",
  384. drawtype = "nodebox",
  385. tiles = {
  386. mat..".png",
  387. mat..".png",
  388. mat..".png",
  389. mat..".png",
  390. mat..".png",
  391. mat..".png^mychisel_htint.png",
  392. },
  393. paramtype = "light",
  394. paramtype2 = "facedir",
  395. drop = item,
  396. groups = gro,
  397. node_box = hori3,
  398. selection_box = hori3
  399. })
  400. minetest.register_node("mychisel:horizontal_"..mat.."4", {
  401. description = "Horizontal"..desc.."4",
  402. drawtype = "nodebox",
  403. tiles = {
  404. mat..".png",
  405. mat..".png",
  406. mat..".png",
  407. mat..".png",
  408. mat..".png",
  409. mat..".png^mychisel_htint.png",
  410. },
  411. paramtype = "light",
  412. paramtype2 = "facedir",
  413. drop = item,
  414. groups = gro,
  415. node_box = hori4,
  416. selection_box = hori4
  417. })
  418. minetest.register_node("mychisel:cross_"..mat.."1", {
  419. description = "cross "..desc.."1",
  420. drawtype = "nodebox",
  421. tiles = {
  422. mat..".png",
  423. mat..".png",
  424. mat..".png",
  425. mat..".png",
  426. mat..".png",
  427. mat..".png^mychisel_ctint.png",
  428. },
  429. paramtype = "light",
  430. paramtype2 = "facedir",
  431. drop = item,
  432. groups = gro,
  433. node_box = cross1,
  434. selection_box = cross1
  435. })
  436. minetest.register_node("mychisel:cross_"..mat.."2", {
  437. description = "cross"..desc.."2",
  438. drawtype = "nodebox",
  439. tiles = {
  440. mat..".png",
  441. mat..".png",
  442. mat..".png",
  443. mat..".png",
  444. mat..".png",
  445. mat..".png^mychisel_ctint.png",
  446. },
  447. paramtype = "light",
  448. paramtype2 = "facedir",
  449. drop = item,
  450. groups = gro,
  451. node_box = cross2,
  452. selection_box = cross2
  453. })
  454. minetest.register_node("mychisel:cross_"..mat.."3", {
  455. description = "cross"..desc.."3",
  456. drawtype = "nodebox",
  457. tiles = {
  458. mat..".png",
  459. mat..".png",
  460. mat..".png",
  461. mat..".png",
  462. mat..".png",
  463. mat..".png^mychisel_ctint.png",
  464. },
  465. paramtype = "light",
  466. paramtype2 = "facedir",
  467. drop = item,
  468. groups = gro,
  469. node_box = cross3,
  470. selection_box = cross3
  471. })
  472. minetest.register_node("mychisel:cross_"..mat.."4", {
  473. description = "cross"..desc.."4",
  474. drawtype = "nodebox",
  475. tiles = {
  476. mat..".png",
  477. mat..".png",
  478. mat..".png",
  479. mat..".png",
  480. mat..".png",
  481. mat..".png^mychisel_ctint.png",
  482. },
  483. paramtype = "light",
  484. paramtype2 = "facedir",
  485. drop = item,
  486. groups = gro,
  487. node_box = cross4,
  488. selection_box = cross4
  489. })
  490. minetest.register_node("mychisel:square_"..mat.."1", {
  491. description = "cross "..desc.."1",
  492. drawtype = "nodebox",
  493. tiles = {
  494. mat..".png",
  495. mat..".png",
  496. mat..".png",
  497. mat..".png",
  498. mat..".png",
  499. mat..".png^mychisel_stint.png",
  500. },
  501. paramtype = "light",
  502. paramtype2 = "facedir",
  503. drop = item,
  504. groups = gro,
  505. node_box = squar1,
  506. selection_box = squar1
  507. })
  508. minetest.register_node("mychisel:square_"..mat.."2", {
  509. description = "cross"..desc.."2",
  510. drawtype = "nodebox",
  511. tiles = {
  512. mat..".png",
  513. mat..".png",
  514. mat..".png",
  515. mat..".png",
  516. mat..".png",
  517. mat..".png^mychisel_stint.png",
  518. },
  519. paramtype = "light",
  520. paramtype2 = "facedir",
  521. drop = item,
  522. groups = gro,
  523. node_box = squar2,
  524. selection_box = squar2
  525. })
  526. minetest.register_node("mychisel:square_"..mat.."3", {
  527. description = "cross"..desc.."3",
  528. drawtype = "nodebox",
  529. tiles = {
  530. mat..".png",
  531. mat..".png",
  532. mat..".png",
  533. mat..".png",
  534. mat..".png",
  535. mat..".png^mychisel_stint.png",
  536. },
  537. paramtype = "light",
  538. paramtype2 = "facedir",
  539. drop = item,
  540. groups = gro,
  541. node_box = squar3,
  542. selection_box = squar3
  543. })
  544. minetest.register_node("mychisel:square_"..mat.."4", {
  545. description = "cross"..desc.."4",
  546. drawtype = "nodebox",
  547. tiles = {
  548. mat..".png",
  549. mat..".png",
  550. mat..".png", mat..".png", mat..".png",
  551. mat..".png^mychisel_stint.png",
  552. },
  553. paramtype = "light",
  554. paramtype2 = "facedir",
  555. drop = item,
  556. groups = gro,
  557. node_box = squar4,
  558. selection_box = squar4
  559. })
  560. minetest.register_node("mychisel:square_"..mat.."4", {
  561. description = "cross"..desc.."4",
  562. drawtype = "nodebox",
  563. tiles = {
  564. mat..".png",
  565. mat..".png",
  566. mat..".png",
  567. mat..".png",
  568. mat..".png",
  569. mat..".png^mychisel_stint.png",
  570. },
  571. paramtype = "light",
  572. paramtype2 = "facedir",
  573. drop = item,
  574. groups = gro,
  575. node_box = squar4,
  576. selection_box = squar4
  577. })
  578. minetest.register_node("mychisel:chisel_deco", {
  579. drawtype = "nodebox",
  580. paramtype = "light",
  581. paramtype2 = "facedir",
  582. tiles = {
  583. "default_steel_block.png",
  584. "default_wood.png",
  585. "mychisel_chisel.png",
  586. "mychisel_chisel.png",
  587. "mychisel_chisel.png",
  588. "mychisel_chisel.png"
  589. },
  590. groups = {
  591. snappy=3,
  592. flammable=2,
  593. not_in_creative_inventory=1
  594. },
  595. node_box = {
  596. type = "fixed",
  597. fixed = {
  598. {-0.125, -0.5, -0.125, 0.125, 0.25, 0.125}, -- NodeBox1
  599. {-0.1875, 0.25, -0.1875, 0.1875, 0.5, 0.1875}, -- NodeBox2
  600. }
  601. },
  602. sounds = default.node_sound_wood_defaults(),
  603. on_dig = function(pos, node, digger)
  604. if digger:is_player() and digger:get_inventory() then
  605. local meta = minetest.env:get_meta(pos)
  606. local wear_out = meta:get_int("wear")
  607. digger:get_inventory():add_item("main", {name="mychisel:chisel", count=1, wear=wear_out, metadata=""})
  608. end
  609. minetest.remove_node(pos)
  610. end,
  611. })
  612. end