2
0

features.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. degrotate_240_steps = true,
  22. abm_min_max_y = true,
  23. particlespawner_tweenable = true,
  24. dynamic_add_media_table = true,
  25. get_sky_as_table = true,
  26. get_light_data_buffer = true,
  27. mod_storage_on_disk = true,
  28. compress_zstd = true,
  29. sound_params_start_time = true,
  30. physics_overrides_v2 = true,
  31. hud_def_type_field = true,
  32. random_state_restore = true,
  33. after_order_expiry_registration = true,
  34. wallmounted_rotate = true,
  35. item_specific_pointabilities = true,
  36. blocking_pointability_type = true,
  37. dynamic_add_media_startup = true,
  38. dynamic_add_media_filepath = true,
  39. lsystem_decoration_type = true,
  40. item_meta_range = true,
  41. node_interaction_actor = true,
  42. moveresult_new_pos = true,
  43. override_item_remove_fields = true,
  44. hotbar_hud_element = true,
  45. bulk_lbms = true,
  46. abm_without_neighbors = true,
  47. }
  48. function core.has_feature(arg)
  49. if type(arg) == "table" then
  50. local missing_features = {}
  51. local result = true
  52. for ftr in pairs(arg) do
  53. if not core.features[ftr] then
  54. missing_features[ftr] = true
  55. result = false
  56. end
  57. end
  58. return result, missing_features
  59. elseif type(arg) == "string" then
  60. if not core.features[arg] then
  61. return false, {[arg]=true}
  62. end
  63. return true, {}
  64. end
  65. end