Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. ############
  2. SCRIPT
  3. ############
  4.  
  5. minetest.register_craft({
  6. output = 'funnystone:funnystone',
  7. recipe = {
  8. {'group:wood', '', ''},
  9. {'', '', ''},
  10. {'', '', ''},
  11. }
  12. })
  13. minetest.register_craft({
  14. output = 'funnystone:funnystone',
  15. recipe = {
  16. {'group:cobble', 'funnystone:funnyblock', ''},
  17. {'', '', ''},
  18. {'', '', ''},
  19. }
  20. })
  21. --uh, I think we dont want the wood craft anymore...
  22. minetest.register_craft({
  23. output = 'funnystone:funnystone 0',
  24. recipe = {
  25. {'group:wood', '', ''},
  26. {'', '', ''},
  27. {'', '', ''},
  28. }
  29. })
  30. print(dump(minetest.get_craft_recipe('funnystone:funnystone')))
  31. print(dump(minetest.get_craft_recipe('funnystone:funnystuff'))) -- non-existing stone
  32.  
  33. ############
  34. OUTPUT: OLD
  35. ############
  36. {
  37. type = "normal",
  38. width = 3,
  39. items = {
  40. "group:wood"
  41. }
  42. }
  43. {
  44. width = 0
  45. }
  46.  
  47. ############
  48. OUTPUT: NEW
  49. ############
  50. {
  51. type = "normal",
  52. width = 3,
  53. output = "funnystone:funnystone",
  54. items = {
  55. "group:cobble",
  56. "funnystone:funnyblock"
  57. }
  58. }
  59. 09:04:45: ERROR[main]: ========== ERROR FROM LUA ===========
  60. 09:04:45: ERROR[main]: Failed to load and run script from
  61. 09:04:45: ERROR[main]: bin/../games/minimal/mods/test/init.lua:
  62. 09:04:45: ERROR[main]: caught (...)
  63. 09:04:45: ERROR[main]: stack traceback:
  64. 09:04:45: ERROR[main]: [C]: in function 'get_craft_recipe'
  65. 09:04:45: ERROR[main]: bin/../games/minimal/mods/test/init.lua:32: in main chunk
  66. 09:04:45: ERROR[main]: ======= END OF ERROR FROM LUA ========
  67. 09:04:45: ERROR[main]: Server: Failed to load and run bin/../games/minimal/mods/test/init.lua
  68. 09:04:45: ERROR[main]: ModError: ModError: Failed to load and run bin/../games/minimal/mods/test/init.lu
  69.  
  70. #########
  71. RESULTS
  72. #########
  73. First output: OLD worse than NEW. OLD fails to recognize that the wood craft has been disabled.
  74. Second output: NEW worse than OLD. NEW crashes instead of outputting.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement