nodes.lua 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. local box = {
  2. type = "fixed",
  3. fixed = {-0.5, -0.5, (-0.5/8)*4, 0.5, 0.5, (0.5/8)*4},
  4. }
  5. local anim = {
  6. type = "vertical_frames",
  7. aspect_w = 16,
  8. aspect_h = 16,
  9. length = 0.9
  10. }
  11. -- Portal liquid. The event-horizon of a portal.
  12. -- Specifically designed with obsidian gates (4x5 vertical frames) in mind.
  13. minetest.register_node("nether:portal_liquid", {
  14. description = 'Portal Liquid (You Hacker, You!)',
  15. paramtype2 = "colorfacedir",
  16. groups = {unbreakable=1, immovable=1, not_in_creative_inventory=1},
  17. drop = "",
  18. drawtype = "nodebox",
  19. paramtype = "light",
  20. palette = "nether_portals_palette.png",
  21. tiles = {
  22. 'nether_transparent.png',
  23. 'nether_transparent.png',
  24. 'nether_transparent.png',
  25. 'nether_transparent.png',
  26. {name='nether_portal.png', animation=anim},
  27. {name='nether_portal.png', animation=anim},
  28. },
  29. node_box = box,
  30. use_texture_alpha = "blend",
  31. walkable = false,
  32. pointable = false,
  33. -- Necessary to allow bone placement, and to let players "pop" the portal by
  34. -- e.g., placing a torch inside.
  35. buildable_to = true,
  36. is_ground_content = false,
  37. diggable = false,
  38. light_source = 5,
  39. sunlight_propagates = true,
  40. post_effect_color = {a = 160, r = 128, g = 0, b = 80},
  41. on_rotate = false,
  42. -- No fixed functions.
  43. on_construct = function(...)
  44. return nether.liquid_on_construct(...)
  45. end,
  46. on_destruct = function(...)
  47. return nether.liquid_on_destruct(...)
  48. end,
  49. on_timer = function(...)
  50. return nether.liquid_on_timer(...)
  51. end,
  52. -- Slow down player movement.
  53. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  54. liquid_viscosity = 8,
  55. liquidtype = "source",
  56. liquid_alternative_flowing = "nether:portal_liquid",
  57. liquid_alternative_source = "nether:portal_liquid",
  58. liquid_renewable = false,
  59. liquid_range = 0,
  60. -- Prevent obtaining this node by getting it to fall.
  61. on_finish_collapse = function(pos, node) minetest.remove_node(pos) end,
  62. on_collapse_to_entity = function() end,
  63. })
  64. -- Invisible portal node. Must be as similar to the regular portal liquid as
  65. -- possible, to permit swapping without damage to metadata/param2 values.
  66. minetest.register_node("nether:portal_hidden", {
  67. description = 'Portal Hidden (You Hacker, You!)',
  68. paramtype2 = "colorfacedir",
  69. groups = {unbreakable=1, immovable=1, not_in_creative_inventory=1},
  70. drop = "",
  71. drawtype = "airlike",
  72. paramtype = "light",
  73. palette = "nether_portals_palette.png",
  74. tiles = {
  75. 'nether_transparent.png',
  76. 'nether_transparent.png',
  77. 'nether_transparent.png',
  78. 'nether_transparent.png',
  79. 'nether_transparent.png',
  80. 'nether_transparent.png',
  81. },
  82. node_box = box,
  83. use_texture_alpha = "blend",
  84. walkable = false,
  85. pointable = false,
  86. -- Necessary to allow bone placement, and to let players "pop" the portal by
  87. -- e.g., placing a torch inside.
  88. buildable_to = true,
  89. is_ground_content = false,
  90. diggable = false,
  91. sunlight_propagates = true,
  92. post_effect_color = {a = 0, r = 0, g = 0, b = 0},
  93. on_rotate = false,
  94. -- No fixed functions.
  95. on_construct = function(...)
  96. return nether.hidden_on_construct(...)
  97. end,
  98. on_destruct = function(...)
  99. return nether.hidden_on_destruct(...)
  100. end,
  101. on_timer = function(...)
  102. return nether.hidden_on_timer(...)
  103. end,
  104. -- Prevent obtaining this node by getting it to fall.
  105. on_finish_collapse = function(pos, node) minetest.remove_node(pos) end,
  106. on_collapse_to_entity = function() end,
  107. })