Guest User


a guest
Jul 11th, 2012
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function handle_recipe_command(cmd, player, stackstring)
  2. minetest.chat_send_player(name, 'you want a recipe for '..stackstring..' hey?')
  4. minetest.debug("DEBUG: "..cmd..' invoked, stackstring="'..stackstring..'"')
  5. minetest.log(cmd..' invoked, stackstring="'..stackstring..'"')
  6. local itemstack = ItemStack(stackstring)
  7. if not itemstack:is_known() then
  8. minetest.chat_send_player(player, 'error: cannot get recipe of an unknown item')
  9. return
  10. end
  11. end
  13. minetest.register_on_chat_message(function(name, message)
  14. local cmd = "/recipe"
  15. if message:sub(0, #cmd) == cmd then
  16. local stackstring = string.match(message, cmd.." (.*)")
  17. if stackstring == nil then
  18. minetest.chat_send_player(name, 'usage: '..cmd..' stackstring')
  19. return true -- Handled chat message
  20. end
  21. handle_recipe_command(cmd, name, stackstring)
  22. return true
  23. end
  25. end)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add to your ad blocker whitelist or disable your adblocking software.