nodes.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. minetest.register_node("quikbild:climb", {
  2. description = "Minigame Climb",
  3. drawtype = "airlike",
  4. tiles = {},
  5. pointable = false,
  6. buildable_to = true,
  7. climbable = true,
  8. walkable = false,
  9. sunlight_propagates = true,
  10. paramtype = 'light',
  11. light_source = 6,
  12. })
  13. quikbild.items = {}
  14. local dyes = dye.dyes
  15. for i = 1, #dyes do
  16. local name, desc = unpack(dyes[i])
  17. minetest.register_node("quikbild:" .. name, {
  18. description = "Minigame ".. desc,
  19. tiles = {"wool_" .. name .. ".png"},
  20. is_ground_content = false,
  21. groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3,
  22. flammable = 3, wool = 1},
  23. sounds = default.node_sound_defaults(),
  24. on_place = function(itemstack, placer, pointed_thing)
  25. if arena_lib.is_player_in_arena(placer:get_player_name(), "quikbild") then
  26. --minetest.chat_send_all('ln17')
  27. local pos = pointed_thing.above
  28. if pos and minetest.get_node(pos).name == 'air' or string.find(minetest.get_node(pos).name,'quikbild') then
  29. --minetest.chat_send_all('ln20')
  30. minetest.set_node(pos, {name="quikbild:" .. name})
  31. return ItemStack("quikbild:" .. name), pos
  32. end
  33. end
  34. end,
  35. drop = {},
  36. on_use = function(itemstack, user, pointed_thing)
  37. if arena_lib.is_player_in_arena(user:get_player_name(), "quikbild") then
  38. local pos = pointed_thing.under
  39. if pos and string.find(minetest.get_node(pos).name,'quikbild') then
  40. minetest.set_node(pos, {name="quikbild:climb"})
  41. end
  42. end
  43. return nil
  44. end,
  45. })
  46. table.insert(quikbild.items,"quikbild:" .. name)
  47. end