init.lua 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. levels = {}
  2. function levels.register_basic(name, desc, sound, vol) --Registers node, stairs, slabs. With same texture on all sides.
  3. vol = vol or 1
  4. minetest.register_node('levels:'..name, {
  5. description = desc,
  6. tiles = {{name='levels_'..name..'.png', align_style='world', scale=4}},
  7. inventory_image = '[inventorycube{levels_'..name..'.png&[sheet:4x4:1,1{levels_'..name..'.png&[sheet:4x4:1,1{levels_'..name..'.png&[sheet:4x4:1,1',
  8. groups = {breakable=1},
  9. sounds = {footstep = {name = sound, gain = vol}}
  10. })
  11. stairs.register_stair_and_slab(name,
  12. {breakable=1},
  13. {{name='levels_'..name..'.png', align_style='world', scale=4}},
  14. {footstep = {name = sound, gain = vol}},
  15. true)
  16. end
  17. function levels.register_tube(name, desc, sound, vol) --Registers node, stairs, slabs. With same texture on all sides.
  18. vol = vol or 1
  19. minetest.register_node('levels:'..name, {
  20. description = desc,
  21. tiles = {'levels_'..name..'_top.png', 'levels_'..name..'_top.png', 'levels_'..name..'_side.png'},
  22. groups = {breakable=1},
  23. sounds = {footstep = {name = sound, gain = vol}},
  24. paramtype2 = 'facedir',
  25. on_place = minetest.rotate_and_place,
  26. })
  27. stairs.register_stair_and_slab(name,
  28. {breakable=1},
  29. {'levels_'..name..'_top.png', 'levels_'..name..'_top.png', 'levels_'..name..'_side.png'},
  30. {footstep = {name = sound, gain = vol}},
  31. true)
  32. end
  33. function levels.register_alpha(name, desc, sound, vol) --Registers node, stairs, slabs. With same texture on all sides.
  34. vol = vol or 1
  35. minetest.register_node('levels:'..name, {
  36. description = desc,
  37. drawtype = 'allfaces',
  38. paramtype = 'light',
  39. tiles = {{name='levels_'..name..'.png', align_style='world', scale=4}},
  40. inventory_image = '[inventorycube{levels_'..name..'.png&[sheet:4x4:1,1{levels_'..name..'.png&[sheet:4x4:1,1{levels_'..name..'.png&[sheet:4x4:1,1',
  41. groups = {breakable=1},
  42. sounds = {footstep = {name = sound, gain = vol}},
  43. paramtype2 = 'facedir',
  44. on_place = minetest.rotate_and_place,
  45. })
  46. end
  47. dofile(minetest.get_modpath('levels')..'/ducts.lua')
  48. dofile(minetest.get_modpath('levels')..'/ground.lua')
  49. dofile(minetest.get_modpath('levels')..'/metal.lua')
  50. dofile(minetest.get_modpath('levels')..'/scifi.lua')
  51. dofile(minetest.get_modpath('levels')..'/stone.lua')
  52. dofile(minetest.get_modpath('levels')..'/wood.lua')