nodes.lua 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. floodable = true,
  34. -- Necessary to allow bone placement, and to let players "pop" the portal by
  35. -- e.g., placing a torch inside.
  36. buildable_to = true,
  37. is_ground_content = false,
  38. diggable = false,
  39. light_source = 5,
  40. sunlight_propagates = true,
  41. post_effect_color = {a = 160, r = 128, g = 0, b = 80},
  42. on_rotate = false,
  43. -- No fixed functions.
  44. on_construct = function(...)
  45. return nether.liquid_on_construct(...)
  46. end,
  47. on_destruct = function(...)
  48. return nether.liquid_on_destruct(...)
  49. end,
  50. on_timer = function(...)
  51. return nether.liquid_on_timer(...)
  52. end,
  53. on_flood = function(...)
  54. return nether.liquid_on_flood(...)
  55. end,
  56. -- Slow down player movement.
  57. movement_speed_multiplier = default.SLOW_SPEED_NETHER,
  58. move_resistance = 3,
  59. -- Prevent obtaining this node by getting it to fall.
  60. on_finish_collapse = function(pos, node) minetest.remove_node(pos) end,
  61. on_collapse_to_entity = function() end,
  62. })
  63. -- Invisible portal node. Must be as similar to the regular portal liquid as
  64. -- possible, to permit swapping without damage to metadata/param2 values.
  65. minetest.register_node("nether:portal_hidden", {
  66. description = 'Portal Hidden (You Hacker, You!)',
  67. paramtype2 = "colorfacedir",
  68. groups = {unbreakable=1, immovable=1, not_in_creative_inventory=1},
  69. drop = "",
  70. drawtype = "airlike",
  71. paramtype = "light",
  72. palette = "nether_portals_palette.png",
  73. tiles = {
  74. 'nether_transparent.png',
  75. 'nether_transparent.png',
  76. 'nether_transparent.png',
  77. 'nether_transparent.png',
  78. 'nether_transparent.png',
  79. 'nether_transparent.png',
  80. },
  81. node_box = box,
  82. use_texture_alpha = "blend",
  83. walkable = false,
  84. pointable = false,
  85. floodable = true,
  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. on_flood = function(...)
  105. return nether.liquid_on_flood(...)
  106. end,
  107. -- Prevent obtaining this node by getting it to fall.
  108. on_finish_collapse = function(pos, node) minetest.remove_node(pos) end,
  109. on_collapse_to_entity = function() end,
  110. })