2
0

deprecated.lua 1.4 KB

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