legacy.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. -- Players
  23. if minetest.get_modpath("player_api") then
  24. default.registered_player_models = player_api.registered_models
  25. default.player_register_model = player_api.register_model
  26. default.player_attached = player_api.player_attached
  27. default.player_get_animation = player_api.get_animation
  28. default.player_set_model = player_api.set_model
  29. default.player_set_textures = player_api.set_textures
  30. default.player_set_animation = player_api.set_animation
  31. end
  32. -- Chests
  33. default.register_chest = default.chest.register_chest