sound_compat.lua 810 B

1234567891011121314151617181920212223242526272829303132333435
  1. local old_node_register = minetest.register_node
  2. local old_craftitem_register = minetest.register_craftitem
  3. local old_tool_register = minetest.register_tool
  4. function minetest.register_node(name, def)
  5. if def.sounds and not def.sound then
  6. def.sound = def.sounds
  7. end
  8. if def.sound and not def.sounds then
  9. def.sounds = def.sound
  10. end
  11. old_node_register(name, def)
  12. end
  13. function minetest.register_craftitem(name, def)
  14. if def.sounds and not def.sound then
  15. def.sound = def.sounds
  16. end
  17. if def.sound and not def.sounds then
  18. def.sounds = def.sound
  19. end
  20. old_craftitem_register(name, def)
  21. end
  22. function minetest.register_tool(name, def)
  23. if def.sounds and not def.sound then
  24. def.sound = def.sounds
  25. end
  26. if def.sound and not def.sounds then
  27. def.sounds = def.sound
  28. end
  29. old_tool_register(name, def)
  30. end