murder_holes.lua 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. -- internationalization boilerplate
  2. local MP = minetest.get_modpath(minetest.get_current_modname())
  3. local S, NS = dofile(MP.."/intllib.lua")
  4. -------------------------------------------------------------------------------------
  5. castle_masonry.register_murderhole = function(material)
  6. local composition_def, burn_time, tile, desc = castle_masonry.get_material_properties(material)
  7. local mod_name = minetest.get_current_modname()
  8. -- Node Definition
  9. minetest.register_node(mod_name..":hole_"..material.name, {
  10. drawtype = "nodebox",
  11. description = S("@1 Murder Hole", desc),
  12. tiles = tile,
  13. groups = composition_def.groups,
  14. sounds = composition_def.sounds,
  15. paramtype = "light",
  16. paramtype2 = "facedir",
  17. node_box = {
  18. type = "fixed",
  19. fixed = {
  20. {-8/16,-8/16,-8/16,-4/16,8/16,8/16},
  21. {4/16,-8/16,-8/16,8/16,8/16,8/16},
  22. {-4/16,-8/16,-8/16,4/16,8/16,-4/16},
  23. {-4/16,-8/16,8/16,4/16,8/16,4/16},
  24. },
  25. },
  26. })
  27. minetest.register_node(mod_name..":machicolation_"..material.name, {
  28. drawtype = "nodebox",
  29. description = S("@1 Machicolation", desc),
  30. tiles = tile,
  31. groups = composition_def.groups,
  32. sounds = composition_def.sounds,
  33. paramtype = "light",
  34. paramtype2 = "facedir",
  35. node_box = {
  36. type = "fixed",
  37. fixed = {
  38. {-0.5, 0, -0.5, 0.5, 0.5, 0},
  39. {-0.5, -0.5, 0, -0.25, 0.5, 0.5},
  40. {0.25, -0.5, 0, 0.5, 0.5, 0.5},
  41. },
  42. },
  43. })
  44. minetest.register_craft({
  45. output = mod_name..":hole_"..material.name.." 4",
  46. recipe = {
  47. {"",material.craft_material, "" },
  48. {material.craft_material,"", material.craft_material},
  49. {"",material.craft_material, ""}
  50. },
  51. })
  52. minetest.register_craft({
  53. output = mod_name..":machicolation_"..material.name,
  54. type="shapeless",
  55. recipe = {mod_name..":hole_"..material.name},
  56. })
  57. minetest.register_craft({
  58. output = mod_name..":hole_"..material.name,
  59. type="shapeless",
  60. recipe = {mod_name..":machicolation_"..material.name},
  61. })
  62. if burn_time > 0 then
  63. minetest.register_craft({
  64. type = "fuel",
  65. recipe = mod_name..":hole_"..material.name,
  66. burntime = burn_time,
  67. })
  68. minetest.register_craft({
  69. type = "fuel",
  70. recipe = mod_name..":machicolation_"..material.name,
  71. burntime = burn_time,
  72. })
  73. end
  74. end
  75. castle_masonry.register_murderhole_alias = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
  76. minetest.register_alias(old_mod_name..":hole_"..old_material_name, new_mod_name..":hole_"..new_material_name)
  77. minetest.register_alias(old_mod_name..":machicolation_"..old_material_name, new_mod_name..":machicolation_"..new_material_name)
  78. end
  79. castle_masonry.register_murderhole_alias_force = function(old_mod_name, old_material_name, new_mod_name, new_material_name)
  80. minetest.register_alias_force(old_mod_name..":hole_"..old_material_name, new_mod_name..":hole_"..new_material_name)
  81. minetest.register_alias_force(old_mod_name..":machicolation_"..old_material_name, new_mod_name..":machicolation_"..new_material_name)
  82. end