init.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. local modname = minetest.get_current_modname()
  2. local S = minetest.get_translator(modname)
  3. minetest.register_node(modname .. ":pebble",
  4. {
  5. description = S("Pebble"),
  6. drawtype = "nodebox",
  7. tiles = {"eg_pebbles_stone.png"},
  8. paramtype = "light",
  9. floodable = true,
  10. node_box =
  11. {
  12. type = "fixed",
  13. fixed = {-0.0625, -0.5, -0.125, 0.125, -0.375, 0.125}
  14. },
  15. groups = {dig_immediate = 3, attached_node = 1},
  16. tool_capabilities =
  17. {
  18. full_punch_interval = 1.5,
  19. --max_drop_level = 1,
  20. groupcaps =
  21. {
  22. cracky = {maxlevel = 2, times = {[1] = 15, [2] = 10, [3] = 6}},
  23. choppy = {maxlevel = 2, times = {5, 4.5, 3}},
  24. }
  25. },
  26. sounds =
  27. {
  28. footstep = {name = "stone_footstep", gain = 0.3},
  29. dig = {name = "stone_dig", gain = 0.5},
  30. dug = {name = "stone_footstep", gain = 1.0},
  31. place = {name = "stone_place", gain = 1.0},
  32. },
  33. })
  34. if minetest.get_modpath("eg_mapgen")
  35. then
  36. minetest.register_decoration(
  37. {
  38. deco_type = "simple",
  39. sidelen = 8,
  40. place_on = {"eg_mapgen:grass", "eg_mapgen:stone", "eg_mapgen:sand"},
  41. fill_ratio = 0.05,
  42. spawn_by = "eg_mapgen:stone",
  43. num_spawn_by = 2,
  44. flags = "all_floors",
  45. decoration = modname .. ":pebble",
  46. })
  47. end