minestats.lua 1.2 KB

123456789101112131415161718192021222324252627282930
  1. -- Renew mod for Minetest
  2. -- Copyright © 2018 Alex Yst <https://y.st./>
  3. -- This program is free software; you can redistribute it and/or
  4. -- modify it under the terms of the GNU Lesser General Public
  5. -- License as published by the Free Software Foundation; either
  6. -- version 2.1 of the License, or (at your option) any later version.
  7. -- This software is distributed in the hope that it will be useful,
  8. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. -- Lesser General Public License for more details.
  11. -- You should have received a copy of the GNU Lesser General Public
  12. -- License along with this program. If not, see
  13. -- <https://www.gnu.org./licenses/>.
  14. if minetest.get_modpath("minestats") then
  15. __minestats__.register_is_countable(function(node_name, drop, drop_opts)
  16. if node_name:sub(1, 6) == "renew:" then
  17. local start = drop:find(":") + 1
  18. return drop:sub(start) == node_name:sub(7)
  19. else
  20. return (drop == "default:coral_skeleton" and minetest.get_mapgen_params().mgname ~= "v6")
  21. or (node_name == "default:cobble" and drop == "default:gravel")
  22. or (node_name == "default:cobble" and drop == "default:silver_sand")
  23. end
  24. end)
  25. end