legacy.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -- mods/default/legacy.lua
  2. -- Horrible stuff to support old code registering falling nodes
  3. -- Don't use this and never do what this does, it's completely wrong!
  4. -- (More specifically, the client and the C++ code doesn't get the group)
  5. function default.register_falling_node(nodename, texture)
  6. minetest.log("error", debug.traceback())
  7. minetest.log('error', "WARNING: default.register_falling_node is deprecated")
  8. if minetest.registered_nodes[nodename] then
  9. minetest.registered_nodes[nodename].groups.falling_node = 1
  10. end
  11. end
  12. function default.spawn_falling_node(p, nodename)
  13. spawn_falling_node(p, nodename)
  14. end
  15. -- Liquids
  16. WATER_ALPHA = minetest.registered_nodes["default:water_source"].alpha
  17. WATER_VISC = minetest.registered_nodes["default:water_source"].liquid_viscosity
  18. LAVA_VISC = minetest.registered_nodes["default:lava_source"].liquid_viscosity
  19. LIGHT_MAX = default.LIGHT_MAX
  20. -- Formspecs
  21. default.gui_suvival_form = default.gui_survival_form
  22. default.gui_bg = ""
  23. default.gui_bg_img = ""
  24. default.gui_slots = ""
  25. -- Players
  26. if minetest.get_modpath("player_api") then
  27. default.registered_player_models = player_api.registered_models
  28. default.player_register_model = player_api.register_model
  29. default.player_attached = player_api.player_attached
  30. default.player_get_animation = player_api.get_animation
  31. default.player_set_model = player_api.set_model
  32. default.player_set_textures = player_api.set_textures
  33. default.player_set_animation = player_api.set_animation
  34. end
  35. -- Chests
  36. default.register_chest = default.chest.register_chest
  37. -- Check for a volume intersecting protection
  38. function default.intersects_protection(minp, maxp, player_name, interval)
  39. minetest.log("warning", "default.intersects_protection() is " ..
  40. "deprecated, use minetest.is_area_protected() instead.")
  41. return minetest.is_area_protected(minp, maxp, player_name, interval)
  42. end