fences.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. local S = ethereal.intllib
  2. local door_mod = minetest.get_modpath("doors")
  3. local add_fence = function(name, node, desc, texture)
  4. if default.register_fence then
  5. default.register_fence("ethereal:fence_" .. name, {
  6. description = S(desc .. " Fence"),
  7. texture = texture .. ".png",
  8. material = "ethereal:" .. node,
  9. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  10. sounds = default.node_sound_wood_defaults(),
  11. check_for_pole = true
  12. })
  13. end
  14. if default.register_fence_rail then
  15. default.register_fence_rail("ethereal:fence_rail_" .. name, {
  16. description = S(desc .. " Fence Rail"),
  17. texture = texture .. ".png",
  18. material = "ethereal:" .. node,
  19. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  20. sounds = default.node_sound_wood_defaults()
  21. })
  22. end
  23. if door_mod and doors.register_fencegate then
  24. doors.register_fencegate("ethereal:fencegate_" .. name, {
  25. description = S(desc .. " Fence Gate"),
  26. texture = texture .. ".png",
  27. material = "ethereal:" .. node,
  28. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}
  29. })
  30. end
  31. if default.register_mesepost then
  32. default.register_mesepost("ethereal:mese_post_" .. name, {
  33. description = S(desc .. " Mese Post Light"),
  34. texture = texture .. ".png",
  35. material = "ethereal:" .. node,
  36. })
  37. end
  38. end
  39. add_fence("scorched", "scorched_tree", "Scorched", "ethereal_scorched_tree")
  40. add_fence("frostwood", "frost_wood", "Frost", "ethereal_frost_wood")
  41. add_fence("redwood", "redwood_wood", "Redwood", "ethereal_redwood_wood")
  42. add_fence("willow", "willow_wood", "Willow", "ethereal_willow_wood")
  43. add_fence("yellowwood", "yellow_wood", "Healing Wood", "ethereal_yellow_wood")
  44. add_fence("palm", "palm_wood", "Palm", "moretrees_palm_wood")
  45. add_fence("banana", "banana_wood", "Banana Wood", "ethereal_banana_wood")
  46. add_fence("mushroom", "mushroom_trunk", "Mushroom", "ethereal_mushroom_trunk")
  47. add_fence("birch", "birch_wood", "Birch", "moretrees_birch_wood")
  48. add_fence("sakura", "sakura_wood", "Sakura", "ethereal_sakura_wood")
  49. add_fence("olive", "olive_wood", "Olive", "ethereal_olive_wood")
  50. -- add compatibility for ethereal's to default wooden gates
  51. minetest.register_alias("ethereal:fencegate_wood_open", "doors:gate_wood_open")
  52. minetest.register_alias("ethereal:fencegate_wood_closed", "doors:gate_wood_closed")
  53. minetest.register_alias("ethereal:fencegate_acacia_open", "doors:gate_acacia_wood_open")
  54. minetest.register_alias("ethereal:fencegate_acacia_closed", "doors:gate_acacia_wood_closed")
  55. minetest.register_alias("ethereal:fencegate_junglewood_open", "doors:gate_junglewood_open")
  56. minetest.register_alias("ethereal:fencegate_junglewood_closed", "doors:gate_junglewood_closed")
  57. minetest.register_alias("ethereal:fencegate_pine_open", "doors:gate_pine_wood_open")
  58. minetest.register_alias("ethereal:fencegate_pine_closed", "doors:gate_pine_wood_closed")
  59. -- sakura door
  60. if door_mod then
  61. doors.register("ethereal:door_sakura", {
  62. tiles = {
  63. {name = "ethereal_sakura_door.png", backface_culling = true}
  64. },
  65. description = S("Sakura Wood Door"),
  66. inventory_image = "ethereal_sakura_door_inv.png",
  67. groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  68. sound_open = "doors_glass_door_open",
  69. sound_close = "doors_glass_door_close",
  70. recipe = {
  71. {"group:stick", "default:paper"},
  72. {"default:paper", "group:stick"},
  73. {"ethereal:sakura_wood", "ethereal:sakura_wood"}
  74. }
  75. })
  76. minetest.register_alias("ethereal:sakura_door", "ethereal:door_sakura")
  77. minetest.register_alias("ethereal:sakura_door_a", "ethereal:door_sakura_a")
  78. minetest.register_alias("ethereal:sakura_door_b", "ethereal:door_sakura_b")
  79. end