features.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. -- Minetest: builtin/features.lua
  2. core.features = {
  3. glasslike_framed = true,
  4. nodebox_as_selectionbox = true,
  5. get_all_craft_recipes_works = true,
  6. use_texture_alpha = true,
  7. no_legacy_abms = true,
  8. texture_names_parens = true,
  9. area_store_custom_ids = true,
  10. add_entity_with_staticdata = true,
  11. no_chat_message_prediction = true,
  12. object_use_texture_alpha = true,
  13. object_independent_selectionbox = true,
  14. httpfetch_binary_data = true,
  15. formspec_version_element = true,
  16. area_store_persistent_ids = true,
  17. pathfinder_works = true,
  18. object_step_has_moveresult = true,
  19. direct_velocity_on_players = true,
  20. use_texture_alpha_string_modes = true,
  21. }
  22. function core.has_feature(arg)
  23. if type(arg) == "table" then
  24. local missing_features = {}
  25. local result = true
  26. for ftr in pairs(arg) do
  27. if not core.features[ftr] then
  28. missing_features[ftr] = true
  29. result = false
  30. end
  31. end
  32. return result, missing_features
  33. elseif type(arg) == "string" then
  34. if not core.features[arg] then
  35. return false, {[arg]=true}
  36. end
  37. return true, {}
  38. end
  39. end