You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
5.1KB

  1. --[[
  2. More Blocks: alias definitions
  3. Copyright © 2011-2020 Hugo Locurcio and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. -- More Blocks aliases:
  7. minetest.register_alias("sweeper", "moreblocks:sweeper")
  8. minetest.register_alias("circular_saw", "moreblocks:circular_saw")
  9. minetest.register_alias("jungle_stick", "moreblocks:jungle_stick")
  10. -- Old block/item replacement:
  11. minetest.register_alias("moreblocks:oerkkiblock", "default:mossycobble")
  12. minetest.register_alias("moreblocks:screwdriver", "screwdriver:screwdriver")
  13. -- Node and item renaming:
  14. minetest.register_alias("moreblocks:stone_bricks", "default:stonebrick")
  15. minetest.register_alias("moreblocks:stonebrick", "default:stonebrick")
  16. minetest.register_alias("moreblocks:junglewood", "default:junglewood")
  17. minetest.register_alias("moreblocks:jungle_wood", "default:junglewood")
  18. minetest.register_alias("moreblocks:fence_junglewood", "default:fence_junglewood")
  19. minetest.register_alias("moreblocks:fence_jungle_wood", "default:fence_junglewood")
  20. minetest.register_alias("moreblocks:jungle_stick", "default:stick")
  21. for _, t in pairs(circular_saw.names) do
  22. minetest.register_alias("moreblocks:" .. t[1] .. "_jungle_wood" .. t[2],
  23. "moreblocks:" .. t[1] .. "_junglewood" .. t[2])
  24. end
  25. minetest.register_alias("moreblocks:horizontaltree", "moreblocks:horizontal_tree")
  26. minetest.register_alias("moreblocks:horizontaljungletree", "moreblocks:horizontal_jungle_tree")
  27. minetest.register_alias("moreblocks:stonesquare", "moreblocks:stone_tile")
  28. minetest.register_alias("moreblocks:circlestonebrick", "moreblocks:circle_stone_bricks")
  29. minetest.register_alias("moreblocks:ironstonebrick", "moreblocks:iron_stone_bricks")
  30. minetest.register_alias("moreblocks:coalstone", "moreblocks:coal_stone")
  31. minetest.register_alias("moreblocks:ironstone", "moreblocks:iron_stone")
  32. minetest.register_alias("moreblocks:woodtile", "moreblocks:wood_tile")
  33. minetest.register_alias("moreblocks:woodtile_full", "moreblocks:wood_tile_full")
  34. minetest.register_alias("moreblocks:woodtile_centered", "moreblocks:wood_tile_centered")
  35. minetest.register_alias("moreblocks:woodtile_up", "moreblocks:wood_tile_offset")
  36. minetest.register_alias("moreblocks:wood_tile_up", "moreblocks:wood_tile_offset")
  37. minetest.register_alias("moreblocks:woodtile_down", "moreblocks:wood_tile_down")
  38. minetest.register_alias("moreblocks:woodtile_left", "moreblocks:wood_tile_left")
  39. minetest.register_alias("moreblocks:woodtile_right", "moreblocks:wood_tile_right")
  40. minetest.register_alias("moreblocks:coalglass", "moreblocks:coal_glass")
  41. minetest.register_alias("moreblocks:ironglass", "moreblocks:iron_glass")
  42. minetest.register_alias("moreblocks:glowglass", "moreblocks:glow_glass")
  43. minetest.register_alias("moreblocks:superglowglass", "moreblocks:super_glow_glass")
  44. minetest.register_alias("moreblocks:trapglass", "moreblocks:trap_glass")
  45. minetest.register_alias("moreblocks:trapstone", "moreblocks:trap_stone")
  46. minetest.register_alias("moreblocks:cactuschecker", "moreblocks:cactus_checker")
  47. minetest.register_alias("moreblocks:coalchecker", "moreblocks:coal_checker")
  48. minetest.register_alias("moreblocks:ironchecker", "moreblocks:iron_checker")
  49. minetest.register_alias("moreblocks:cactusbrick", "moreblocks:cactus_brick")
  50. minetest.register_alias("moreblocks:cleanglass", "moreblocks:clean_glass")
  51. minetest.register_alias("moreblocks:emptybookshelf", "moreblocks:empty_bookshelf")
  52. minetest.register_alias("moreblocks:junglestick", "moreblocks:jungle_stick")
  53. minetest.register_alias("moreblocks:splitstonesquare","moreblocks:split_stone_tile")
  54. minetest.register_alias("moreblocks:allfacestree","moreblocks:all_faces_tree")
  55. minetest.register_alias("moreblocks:empty_bookshelf","moreblocks:empty_shelf")
  56. minetest.register_alias("moreblocks:split_stone_tile_alt","moreblocks:checker_stone_tile")
  57. -- ABM for horizontal trees (fix facedir):
  58. local horizontal_tree_convert_facedir = {7, 12, 9, 18}
  59. minetest.register_abm({
  60. nodenames = {"moreblocks:horizontal_tree","moreblocks:horizontal_jungle_tree"},
  61. interval = 1,
  62. chance = 1,
  63. action = function(pos, node)
  64. if node.name == "moreblocks:horizontal_tree" then
  65. node.name = "default:tree"
  66. else
  67. node.name = "default:jungletree"
  68. end
  69. node.param2 = node.param2 < 3 and node.param2 or 0
  70. minetest.set_node(pos, {
  71. name = node.name,
  72. param2 = horizontal_tree_convert_facedir[node.param2 + 1]
  73. })
  74. end,
  75. })
  76. minetest.register_lbm({
  77. name = "moreblocks:reduce_wood_tile_redundancy",
  78. nodenames = {
  79. "moreblocks:wood_tile_left",
  80. "moreblocks:wood_tile_down",
  81. "moreblocks:wood_tile_right",
  82. "moreblocks:wood_tile_flipped",
  83. },
  84. action = function(pos, node)
  85. if node.name:find("left") then
  86. minetest.set_node(pos, {name = "moreblocks:wood_tile_offset", param2=1})
  87. elseif node.name:find("down") then
  88. minetest.set_node(pos, {name = "moreblocks:wood_tile_offset", param2=2})
  89. elseif node.name:find("right") then
  90. minetest.set_node(pos, {name = "moreblocks:wood_tile_offset", param2=3})
  91. else -- wood_tile_flipped
  92. minetest.set_node(pos, {name = "moreblocks:wood_tile", param2=1})
  93. end
  94. minetest.log('action', "LBM replaced " .. node.name ..
  95. " at " .. minetest.pos_to_string(pos))
  96. end,
  97. })