Revenge of stairs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
792 B

  1. local walign_stairs = minetest.settings:get_bool("stairs_world_align")
  2. if not walign_stairs then
  3. return
  4. end
  5. local stairs_ignore_str = minetest.settings:get("stairs_ignore") or ""
  6. local stairs_ignore = {}
  7. stairs_ignore_str:gsub("[^,]+",function(stairtype)
  8. stairs_ignore[stairtype] = true
  9. end)
  10. minetest.___local_register_node = minetest.register_node
  11. minetest.register_node = function(...)
  12. local args = {...}
  13. if (args[2].drawtype == "nodebox") and (args[1]:match("stair")) then
  14. if not stairs_ignore[args[1]] then
  15. for index,tile in pairs(args[2].tiles) do
  16. if type(tile) == "table" then
  17. tile.align_style = "world"
  18. end
  19. end
  20. end
  21. end
  22. minetest.___local_register_node(unpack(args))
  23. end