tools.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. local S = dlxtrains.S
  2. minetest.register_tool("dlxtrains:wagon_updater", {
  3. description = S("DLX Wagon Updater tool\n\nLeft-click: Update DLX wagon to refresh its appearance, typically in case of an inventory change"),
  4. inventory_image = "dlxtrains_wagon_updater.png",
  5. wield_image = "dlxtrains_wagon_updater.png",
  6. stack_max = 1,
  7. })
  8. minetest.register_tool("dlxtrains:age_selector", {
  9. description = S("DLX Age Selector tool\n\nLeft-click: Toggle age appearance of DLX wagon"),
  10. inventory_image = "dlxtrains_age_selector.png",
  11. wield_image = "dlxtrains_age_selector.png",
  12. stack_max = 1,
  13. })
  14. minetest.register_tool("dlxtrains:livery_selector", {
  15. description = S("DLX Livery Selector tool\n\nLeft-click: Change DLX wagon to next livery scheme\nSneak+Left-click: Change DLX wagon to previous livery scheme"),
  16. inventory_image = "dlxtrains_livery_selector.png",
  17. wield_image = "dlxtrains_livery_selector.png",
  18. stack_max = 1,
  19. })
  20. if dlxtrains.crafting_enabled() then
  21. minetest.register_craft({
  22. output = "dlxtrains:wagon_updater",
  23. recipe = {
  24. {dlxtrains.materials.glass, dlxtrains.materials.diamond, dlxtrains.materials.glass},
  25. {dlxtrains.materials.stick, dlxtrains.materials.mese, dlxtrains.materials.stick},
  26. {dlxtrains.materials.stick, "dlxtrains:blueprint", dlxtrains.materials.stick},
  27. }
  28. })
  29. minetest.register_craft({
  30. output = "dlxtrains:age_selector",
  31. recipe = {
  32. {dlxtrains.materials.desert_sand, dlxtrains.materials.obsidian_glass, dlxtrains.materials.steel_ingot},
  33. {dlxtrains.materials.glass, "dlxtrains:wagon_updater", dlxtrains.materials.gold_ingot},
  34. {dlxtrains.materials.desert_sand, "dlxtrains:blueprint", dlxtrains.materials.tin_ingot},
  35. }
  36. })
  37. minetest.register_craft({
  38. output = "dlxtrains:livery_selector",
  39. recipe = {
  40. {dlxtrains.materials.dye_grey, dlxtrains.materials.obsidian_glass, dlxtrains.materials.diamond},
  41. {dlxtrains.materials.dye_red, "dlxtrains:wagon_updater", dlxtrains.materials.gold_ingot},
  42. {dlxtrains.materials.dye_cyan, "dlxtrains:blueprint", dlxtrains.materials.bronze_ingot},
  43. }
  44. })
  45. end