liquids.lua 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. -- Add liquids for ranges and viscosity levels 0-8
  2. for d=0, 8 do
  3. minetest.register_node("testnodes:rliquid_"..d, {
  4. description = "Test Liquid Source, Range "..d,
  5. drawtype = "liquid",
  6. tiles = {"testnodes_liquidsource_r"..d..".png"},
  7. special_tiles = {
  8. {name = "testnodes_liquidsource_r"..d..".png", backface_culling = false},
  9. {name = "testnodes_liquidsource_r"..d..".png", backface_culling = true},
  10. },
  11. use_texture_alpha = "blend",
  12. paramtype = "light",
  13. walkable = false,
  14. buildable_to = true,
  15. is_ground_content = false,
  16. liquidtype = "source",
  17. liquid_alternative_flowing = "testnodes:rliquid_flowing_"..d,
  18. liquid_alternative_source = "testnodes:rliquid_"..d,
  19. liquid_range = d,
  20. })
  21. minetest.register_node("testnodes:rliquid_flowing_"..d, {
  22. description = "Flowing Test Liquid, Range "..d,
  23. drawtype = "flowingliquid",
  24. tiles = {"testnodes_liquidflowing_r"..d..".png"},
  25. special_tiles = {
  26. {name = "testnodes_liquidflowing_r"..d..".png", backface_culling = false},
  27. {name = "testnodes_liquidflowing_r"..d..".png", backface_culling = false},
  28. },
  29. use_texture_alpha = "blend",
  30. paramtype = "light",
  31. paramtype2 = "flowingliquid",
  32. walkable = false,
  33. buildable_to = true,
  34. is_ground_content = false,
  35. liquidtype = "flowing",
  36. liquid_alternative_flowing = "testnodes:rliquid_flowing_"..d,
  37. liquid_alternative_source = "testnodes:rliquid_"..d,
  38. liquid_range = d,
  39. })
  40. local mod = "^[colorize:#000000:127"
  41. minetest.register_node("testnodes:vliquid_"..d, {
  42. description = "Test Liquid Source, Viscosity "..d,
  43. drawtype = "liquid",
  44. tiles = {"testnodes_liquidsource_r"..d..".png"..mod},
  45. special_tiles = {
  46. {name = "testnodes_liquidsource_r"..d..".png"..mod, backface_culling = false},
  47. {name = "testnodes_liquidsource_r"..d..".png"..mod, backface_culling = true},
  48. },
  49. use_texture_alpha = "blend",
  50. paramtype = "light",
  51. walkable = false,
  52. buildable_to = true,
  53. is_ground_content = false,
  54. liquidtype = "source",
  55. liquid_alternative_flowing = "testnodes:vliquid_flowing_"..d,
  56. liquid_alternative_source = "testnodes:vliquid_"..d,
  57. liquid_viscosity = d,
  58. })
  59. minetest.register_node("testnodes:vliquid_flowing_"..d, {
  60. description = "Flowing Test Liquid, Viscosity "..d,
  61. drawtype = "flowingliquid",
  62. tiles = {"testnodes_liquidflowing_r"..d..".png"..mod},
  63. special_tiles = {
  64. {name = "testnodes_liquidflowing_r"..d..".png"..mod, backface_culling = false},
  65. {name = "testnodes_liquidflowing_r"..d..".png"..mod, backface_culling = false},
  66. },
  67. use_texture_alpha = "blend",
  68. paramtype = "light",
  69. paramtype2 = "flowingliquid",
  70. walkable = false,
  71. buildable_to = true,
  72. is_ground_content = false,
  73. liquidtype = "flowing",
  74. liquid_alternative_flowing = "testnodes:vliquid_flowing_"..d,
  75. liquid_alternative_source = "testnodes:vliquid_"..d,
  76. liquid_viscosity = d,
  77. })
  78. end