2
0

features.lua 622 B

12345678910111213141516171819202122232425262728
  1. -- Minetest: builtin/features.lua
  2. minetest.features = {
  3. glasslike_framed = true,
  4. nodebox_as_selectionbox = true,
  5. chat_send_player_param3 = true,
  6. get_all_craft_recipes_works = true,
  7. use_texture_alpha = true,
  8. }
  9. function minetest.has_feature(arg)
  10. if type(arg) == "table" then
  11. missing_features = {}
  12. result = true
  13. for ft, _ in pairs(arg) do
  14. if not minetest.features[ftr] then
  15. missing_features[ftr] = true
  16. result = false
  17. end
  18. end
  19. return result, missing_features
  20. elseif type(arg) == "string" then
  21. if not minetest.features[arg] then
  22. return false, {[arg]=true}
  23. end
  24. return true, {}
  25. end
  26. end