tools.lua 692 B

123456789101112131415161718192021222324252627282930
  1. local MT = minetest
  2. local vMod = vm_lighting_wand
  3. local modname = vMod.modname
  4. vMod.tool = modname .. ":lighting_wand"
  5. -- the light "placer/remover" wand
  6. MT.register_tool(
  7. vMod.tool,
  8. {
  9. description = vMod.locate("Lighting Wand"),
  10. inventory_image = vMod.modname .. "_lighting_wand.png",
  11. wield_scale = {x = 2, y = 2, z = 2},
  12. range = 0,
  13. tool_capabilities = {
  14. full_punch_interval = 1,
  15. max_drop_level = 0,
  16. groupcaps = {},
  17. damage_groups = {}
  18. },
  19. on_use = function(itemstack, player, pointed_thing)
  20. vMod.cast_wand(player)
  21. return itemstack
  22. end,
  23. on_secondary_use = function(itemstack, player, pointed_thing)
  24. vMod.open_gui(player)
  25. return itemstack
  26. end
  27. }
  28. )