nodes.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. local S = farming.intllib
  2. local add_soil = function(item,soil)
  3. minetest.override_item(item,{
  4. soil = {
  5. base = item,
  6. dry = soil,
  7. wet = soil.."_wet"
  8. }
  9. })
  10. end
  11. for i,v in ipairs(farming.change_soil) do
  12. add_soil(v,"farming:soil")
  13. end
  14. -- override desert items
  15. if (farming.change_soil_desert == nil) then
  16. farming.change_soil_desert = {"default:desert_sand"}
  17. end
  18. for i,v in ipairs(farming.change_soil_desert) do
  19. add_soil(v,"farming:desert_sand_soil")
  20. end
  21. -- register nodes
  22. minetest.register_node("farming:soil", {
  23. description = "Soil",
  24. tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"},
  25. drop = "default:dirt",
  26. groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1},
  27. sounds = default.node_sound_dirt_defaults(),
  28. soil = {
  29. base = "default:dirt",
  30. dry = "farming:soil",
  31. wet = "farming:soil_wet"
  32. }
  33. })
  34. minetest.register_node("farming:soil_wet", {
  35. description = "Wet Soil",
  36. tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"},
  37. drop = "default:dirt",
  38. groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1},
  39. sounds = default.node_sound_dirt_defaults(),
  40. soil = {
  41. base = "default:dirt",
  42. dry = "farming:soil",
  43. wet = "farming:soil_wet"
  44. }
  45. })
  46. minetest.register_node("farming:desert_sand_soil", {
  47. description = "Desert Sand Soil",
  48. drop = "default:desert_sand",
  49. tiles = {"farming_desert_sand_soil.png", "default_desert_sand.png"},
  50. groups = {crumbly=3, not_in_creative_inventory = 1, falling_node=1, sand=1, soil = 2, desert = 1, field = 1},
  51. sounds = default.node_sound_sand_defaults(),
  52. soil = {
  53. base = "default:desert_sand",
  54. dry = "farming:desert_sand_soil",
  55. wet = "farming:desert_sand_soil_wet"
  56. }
  57. })
  58. minetest.register_node("farming:desert_sand_soil_wet", {
  59. description = "Wet Desert Sand Soil",
  60. drop = "default:desert_sand",
  61. tiles = {"farming_desert_sand_soil_wet.png", "farming_desert_sand_soil_wet_side.png"},
  62. groups = {crumbly=3, falling_node=1, sand=1, not_in_creative_inventory=1, soil=3, wet = 1, desert = 1, field = 1},
  63. sounds = default.node_sound_sand_defaults(),
  64. soil = {
  65. base = "default:desert_sand",
  66. dry = "farming:desert_sand_soil",
  67. wet = "farming:desert_sand_soil_wet"
  68. }
  69. })
  70. minetest.register_node("farming:straw", {
  71. description = S("Straw"),
  72. tiles = {"farming_straw.png"},
  73. inventory_image = {"farming_straw.png"},
  74. is_ground_content = false,
  75. groups = {snappy=3, flammable=2, fall_damage_add_percent=-30},
  76. sounds = default.node_sound_leaves_defaults(),
  77. })
  78. minetest.register_node("farming:hemp_fibre", {
  79. description = S("Hemp Fibre"),
  80. tiles = {"farming_hemp_fibre.png"},
  81. inventory_image = "farming_hemp_fibre.png",
  82. is_ground_content = false,
  83. groups = {snappy=3, flammable=2, fall_damage_add_percent=-30},
  84. sounds = default.node_sound_leaves_defaults(),
  85. })
  86. minetest.register_node("farming:nettle_fibre", {
  87. description = ("Nettle Fibre"),
  88. tiles = {"farming_nettle_fibre.png"},
  89. inventory_image = "farming_nettle_fibre.png",
  90. is_ground_content = false,
  91. groups = {snappy=3, flammable=2, fall_damage_add_percent=-30},
  92. sounds = default.node_sound_leaves_defaults(),
  93. })