functions.lua 728 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --[===[
  2. if sumpf.log_level > 0 then
  3. function sumpf.inform(msg, spam, t)
  4. if spam <= sumpf.log_level then
  5. local info
  6. if t then
  7. info = "[sumpf] " .. msg .. (" after ca. %.3g s"):format(
  8. (minetest.get_us_time() - t) / 1000000)
  9. else
  10. info = "[sumpf] "..msg
  11. end
  12. minetest.log("info", info)
  13. if sumpf.log_to_chat then
  14. minetest.chat_send_all(info)
  15. end
  16. end
  17. end
  18. else
  19. function sumpf.inform()
  20. end
  21. end
  22. function sumpf.tree_allowed(pos, minlight)
  23. local light = minetest.get_node_light(pos)
  24. if minetest.get_item_group(
  25. minetest.get_node{x=pos.x, y=pos.y-1, z=pos.z}.name, "soil") ~= 1
  26. or not light then
  27. return false
  28. end
  29. if light < minlight then
  30. return false
  31. end
  32. return true
  33. end
  34. --]===]