2
0

deprecated.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. -- Minetest: builtin/deprecated.lua
  2. --
  3. -- Default material types
  4. --
  5. function digprop_err()
  6. minetest.log("info", debug.traceback())
  7. minetest.log("info", "WARNING: The minetest.digprop_* functions are obsolete and need to be replaced by item groups.")
  8. end
  9. minetest.digprop_constanttime = digprop_err
  10. minetest.digprop_stonelike = digprop_err
  11. minetest.digprop_dirtlike = digprop_err
  12. minetest.digprop_gravellike = digprop_err
  13. minetest.digprop_woodlike = digprop_err
  14. minetest.digprop_leaveslike = digprop_err
  15. minetest.digprop_glasslike = digprop_err
  16. minetest.node_metadata_inventory_move_allow_all = function()
  17. minetest.log("info", "WARNING: minetest.node_metadata_inventory_move_allow_all is obsolete and does nothing.")
  18. end
  19. minetest.add_to_creative_inventory = function(itemstring)
  20. minetest.log('info', "WARNING: minetest.add_to_creative_inventory: This function is deprecated and does nothing.")
  21. end
  22. --
  23. -- EnvRef
  24. --
  25. minetest.env = {}
  26. local envref_deprecation_message_printed = false
  27. setmetatable(minetest.env, {
  28. __index = function(table, key)
  29. if not envref_deprecation_message_printed then
  30. minetest.log("info", "WARNING: minetest.env:[...] is deprecated and should be replaced with minetest.[...]")
  31. envref_deprecation_message_printed = true
  32. end
  33. local func = minetest[key]
  34. if type(func) == "function" then
  35. rawset(table, key, function(self, ...)
  36. return func(...)
  37. end)
  38. else
  39. rawset(table, key, nil)
  40. end
  41. return rawget(table, key)
  42. end
  43. })
  44. function minetest.rollback_get_last_node_actor(pos, range, seconds)
  45. return minetest.rollback_get_node_actions(pos, range, seconds, 1)[1]
  46. end