xpanes.lua 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. local S = minetest.get_translator("mtg_plus")
  2. -- xpanes
  3. xpanes.register_pane("paper", {
  4. description = S("Paper Barrier"),
  5. inventory_image = "mtg_plus_paperwall.png",
  6. wield_image = "mtg_plus_paperwall.png",
  7. textures = {"mtg_plus_paperwall.png", "mtg_plus_paperwall.png", "mtg_plus_paperwall.png"},
  8. groups = {snappy=3, flammable=4, pane=1},
  9. sounds = {
  10. footstep = {name="mtg_plus_paper_step", gain=0.1, max_hear_distance=7},
  11. place = {name="mtg_plus_paper_step", gain=0.3, max_hear_distance=13},
  12. dig = {name="mtg_plus_paper_dig", gain=0.1, max_hear_distance=11},
  13. dug = {name="mtg_plus_paper_dug", gain=0.2, max_hear_distance=13},
  14. },
  15. recipe = {
  16. { "default:paper", "default:paper", "default:paper" },
  17. { "default:paper", "default:paper", "default:paper" },
  18. }
  19. })
  20. local r
  21. if minetest.registered_items["xpanes:paper_flat"] then
  22. r = "xpanes:paper_flat"
  23. else
  24. r = "xpanes:paper"
  25. end
  26. minetest.register_craft({
  27. type = "fuel",
  28. recipe = r,
  29. burntime = 1,
  30. })
  31. xpanes.register_pane("wood", {
  32. description = S("Wooden Bars"),
  33. inventory_image = "mtg_plus_wooden_bar.png",
  34. wield_image = "mtg_plus_wooden_bar.png",
  35. textures = {"mtg_plus_wooden_bar.png", "mtg_plus_wooden_bar_side.png", "mtg_plus_wooden_bar_y.png"},
  36. groups = {choppy=3, oddly_breakable_by_hand=2, flammable=2, pane=1},
  37. sounds = default.node_sound_wood_defaults(),
  38. recipe = {
  39. { "group:wood", "", "group:wood" },
  40. { "group:wood", "", "group:wood" },
  41. { "group:wood", "", "group:wood" },
  42. }
  43. })
  44. if minetest.registered_items["xpanes:wood_flat"] then
  45. r = "xpanes:wood_flat"
  46. else
  47. r = "xpanes:wood"
  48. end
  49. minetest.register_craft({
  50. type = "fuel",
  51. recipe = r,
  52. burntime = 2,
  53. })
  54. xpanes.register_pane("goldglass", {
  55. description = S("Goldglass Pane"),
  56. inventory_image = "mtg_plus_goldglass.png",
  57. wield_image = "mtg_plus_goldglass.png",
  58. textures = {"mtg_plus_goldglass.png","mtg_plus_goldglass_pane_half.png","mtg_plus_goldglass_pane_top.png",},
  59. groups = {cracky=3,oddly_breakable_by_hand=2,pane=1},
  60. sounds = default.node_sound_glass_defaults(),
  61. recipe = {
  62. { "mtg_plus:goldglass","mtg_plus:goldglass","mtg_plus:goldglass", },
  63. { "mtg_plus:goldglass","mtg_plus:goldglass","mtg_plus:goldglass", },
  64. }
  65. })
  66. xpanes.register_pane("goldglass2", {
  67. description = S("Golden Window"),
  68. inventory_image = "mtg_plus_goldglass2.png",
  69. wield_image = "mtg_plus_goldglass2.png",
  70. textures = {"mtg_plus_goldglass2.png","mtg_plus_goldglass_pane_half.png","mtg_plus_goldglass_pane_top.png",},
  71. groups = {cracky=3,oddly_breakable_by_hand=3,pane=1},
  72. sounds = default.node_sound_glass_defaults(),
  73. recipe = {
  74. { "default:gold_ingot","default:gold_ingot","default:gold_ingot", },
  75. { "default:gold_ingot","default:glass","default:gold_ingot", },
  76. { "default:gold_ingot","default:gold_ingot","default:gold_ingot", },
  77. }
  78. })
  79. xpanes.register_pane("papyrus", {
  80. description = S("Papyrus Lattice"),
  81. inventory_image = "mtg_plus_papyrus_lattice.png",
  82. wield_image = "mtg_plus_papyrus_lattice.png",
  83. textures = {"mtg_plus_papyrus_lattice.png","mtg_plus_papyrus_lattice.png","mtg_plus_papyrus_lattice.png"},
  84. groups = {snappy=2, choppy=1, flammable=2,pane=1},
  85. sounds = default.node_sound_leaves_defaults(),
  86. recipe = {
  87. { "default:papyrus", "farming:string", "default:papyrus" },
  88. { "default:papyrus", "farming:string", "default:papyrus" },
  89. }
  90. })
  91. if minetest.registered_items["xpanes:papyrus_flat"] then
  92. r = "xpanes:papyrus_flat"
  93. else
  94. r = "xpanes:papyrus"
  95. end
  96. minetest.register_craft({
  97. type = "fuel",
  98. recipe = r,
  99. burntime = 1,
  100. })
  101. xpanes.register_pane("ice", {
  102. description = S("Ice Window Pane"),
  103. inventory_image = "mtg_plus_ice_window.png",
  104. wield_image = "mtg_plus_ice_window.png",
  105. textures = {"mtg_plus_ice_window.png", "mtg_plus_ice_window.png", "mtg_plus_ice_window.png"},
  106. groups = {cracky=3, slippery = 3, pane=1},
  107. sounds = default.node_sound_glass_defaults(),
  108. recipe = {
  109. { "mtg_plus:ice_window", "mtg_plus:ice_window", "mtg_plus:ice_window", },
  110. { "mtg_plus:ice_window", "mtg_plus:ice_window", "mtg_plus:ice_window", }
  111. }
  112. })
  113. local panes = {
  114. paper = S("Papier barriers are thin solid layers of paper which neatly connect to their neighbors as you build them. They could be useful to separate rooms."),
  115. wood = S("Wooden bars are barriers which neatly connect to their neighbors as you build them."),
  116. goldglass = S("Goldglass panes are thin layers of goldglass which neatly connect to their neighbors as you build them."),
  117. goldglass2 = S("Golden windows are decorative blocks which can be placed into holes for nice-looking windows. Golden windows automatically connect to their neighbors as you build them."),
  118. papyrus = S("Papyrus lattices are strong barriers which neatly connect to their neighbors as you build them."),
  119. ice = S("Ice window panes are thinner than the full ice windows and neatly connect to each other as you build them"),
  120. }
  121. for pane, longdesc in pairs(panes) do
  122. minetest.override_item("xpanes:"..pane.."_flat", {
  123. _doc_items_longdesc = longdesc,
  124. })
  125. minetest.override_item("xpanes:"..pane, {
  126. _doc_items_create_entry = false,
  127. })
  128. if minetest.get_modpath("doc") then
  129. doc.add_entry_alias("nodes", "xpanes:"..pane.."_flat", "nodes", "xpanes:"..pane)
  130. end
  131. end