nodes.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. --
  2. -- Bones sign (sellhead)
  3. --
  4. minetest.register_node("x_marketplace:sign_wall_bones", {
  5. description = "Bones Sign - write '/mp sellhead' to sell heads",
  6. drawtype = "nodebox",
  7. tiles = {"x_marketplace_sign_wall_bones.png"},
  8. inventory_image = "x_marketplace_sign_bones.png",
  9. wield_image = "x_marketplace_sign_bones.png",
  10. paramtype = "light",
  11. paramtype2 = "wallmounted",
  12. sunlight_propagates = true,
  13. is_ground_content = false,
  14. walkable = false,
  15. node_box = {
  16. type = "wallmounted",
  17. wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
  18. wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
  19. wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
  20. },
  21. groups = {crumbly = 2},
  22. sounds = default.node_sound_gravel_defaults(),
  23. on_construct = function(pos)
  24. local meta = minetest.get_meta(pos)
  25. meta:set_string("formspec", "field[text;;${text}]")
  26. end,
  27. on_receive_fields = function(pos, formname, fields, sender)
  28. --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
  29. local player_name = sender:get_player_name()
  30. if minetest.is_protected(pos, player_name) then
  31. minetest.record_protection_violation(pos, player_name)
  32. return
  33. end
  34. local meta = minetest.get_meta(pos)
  35. if not fields.text then return end
  36. minetest.log("action", (player_name or "") .. " wrote \"" ..
  37. fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
  38. meta:set_string("text", fields.text)
  39. meta:set_string("infotext", '"' .. fields.text .. '"')
  40. end,
  41. })
  42. --
  43. -- Mese sign (sell)
  44. --
  45. minetest.register_node("x_marketplace:sign_wall_mese", {
  46. description = "Mese Sign - write '/mp sell' to sell to marketplace",
  47. drawtype = "nodebox",
  48. tiles = {"x_marketplace_sign_wall_mese.png"},
  49. inventory_image = "x_marketplace_sign_mese.png",
  50. wield_image = "x_marketplace_sign_mese.png",
  51. paramtype = "light",
  52. paramtype2 = "wallmounted",
  53. sunlight_propagates = true,
  54. is_ground_content = false,
  55. walkable = false,
  56. node_box = {
  57. type = "wallmounted",
  58. wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
  59. wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
  60. wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
  61. },
  62. groups = {cracky = 1, level = 2},
  63. sounds = default.node_sound_stone_defaults(),
  64. on_construct = function(pos)
  65. local meta = minetest.get_meta(pos)
  66. meta:set_string("formspec", "field[text;;${text}]")
  67. end,
  68. on_receive_fields = function(pos, formname, fields, sender)
  69. --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
  70. local player_name = sender:get_player_name()
  71. if minetest.is_protected(pos, player_name) then
  72. minetest.record_protection_violation(pos, player_name)
  73. return
  74. end
  75. local meta = minetest.get_meta(pos)
  76. if not fields.text then return end
  77. minetest.log("action", (player_name or "") .. " wrote \"" ..
  78. fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
  79. meta:set_string("text", fields.text)
  80. meta:set_string("infotext", '"' .. fields.text .. '"')
  81. end,
  82. })
  83. --
  84. -- Diamond sign (buy)
  85. --
  86. minetest.register_node("x_marketplace:sign_wall_diamond", {
  87. description = "Diamond Sign - write '/mp buy' to buy from marketplace",
  88. drawtype = "nodebox",
  89. tiles = {"x_marketplace_sign_wall_diamond.png"},
  90. inventory_image = "x_marketplace_sign_diamond.png",
  91. wield_image = "x_marketplace_sign_diamond.png",
  92. paramtype = "light",
  93. paramtype2 = "wallmounted",
  94. sunlight_propagates = true,
  95. is_ground_content = false,
  96. walkable = false,
  97. node_box = {
  98. type = "wallmounted",
  99. wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
  100. wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
  101. wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
  102. },
  103. groups = {cracky = 1, level = 3},
  104. sounds = default.node_sound_stone_defaults(),
  105. on_construct = function(pos)
  106. local meta = minetest.get_meta(pos)
  107. meta:set_string("formspec", "field[text;;${text}]")
  108. end,
  109. on_receive_fields = function(pos, formname, fields, sender)
  110. --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
  111. local player_name = sender:get_player_name()
  112. if minetest.is_protected(pos, player_name) then
  113. minetest.record_protection_violation(pos, player_name)
  114. return
  115. end
  116. local meta = minetest.get_meta(pos)
  117. if not fields.text then return end
  118. minetest.log("action", (player_name or "") .. " wrote \"" ..
  119. fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
  120. meta:set_string("text", fields.text)
  121. meta:set_string("infotext", '"' .. fields.text .. '"')
  122. end,
  123. })
  124. --
  125. -- CRAFTING
  126. --
  127. minetest.register_craft({
  128. output = "x_marketplace:sign_wall_bones",
  129. recipe = {
  130. {"bones:bones", "bones:bones", "bones:bones"},
  131. {"bones:bones", "bones:bones", "bones:bones"},
  132. {"", "group:stick", ""},
  133. }
  134. })
  135. minetest.register_craft({
  136. output = "x_marketplace:sign_wall_mese",
  137. recipe = {
  138. {"default:mese_crystal", "default:mese_crystal", "default:mese_crystal"},
  139. {"default:mese_crystal", "default:mese_crystal", "default:mese_crystal"},
  140. {"", "group:stick", ""},
  141. }
  142. })
  143. minetest.register_craft({
  144. output = "x_marketplace:sign_wall_diamond",
  145. recipe = {
  146. {"default:diamond", "default:diamond", "default:diamond"},
  147. {"default:diamond", "default:diamond", "default:diamond"},
  148. {"", "group:stick", ""},
  149. }
  150. })