flooring.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. local function register_basic(name, desc) --Registers node, stairs, slabs. With same texture on all sides.
  2. minetest.register_node('furniture:'..name, {
  3. description = desc,
  4. tiles = {{name='furniture_'..name..'.png', align_style='world', scale=4}},
  5. inventory_image = '[inventorycube{furniture_'..name..'.png&[sheet:4x4:1,1{furniture_'..name..'.png&[sheet:4x4:1,1{furniture_'..name..'.png&[sheet:4x4:1,1',
  6. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
  7. sounds = default.node_sound_wood_defaults(),
  8. })
  9. stairs.register_stair_and_slab(
  10. name,
  11. 'furniture:'..name,
  12. {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
  13. {{name='furniture_'..name..'.png', align_style='world', scale=4}},
  14. desc..' Stair',
  15. desc..' Slab',
  16. default.node_sound_wood_defaults(),
  17. true)
  18. end
  19. register_basic('wood_1', 'Wood Floor (Style 1)')
  20. register_basic('wood_2', 'Wood Floor (Style 2)')
  21. register_basic('wood_3', 'Wood Floor (Style 3)')
  22. register_basic('wood_4', 'Wood Floor (Style 4)')
  23. minetest.register_craft({
  24. output = 'furniture:wood_1 2',
  25. recipe = {
  26. {'default:wood', 'default:junglewood'}
  27. }
  28. })
  29. minetest.register_craft({
  30. output = 'furniture:wood_2 2',
  31. recipe = {
  32. {'default:junglewood', 'default:wood'}
  33. }
  34. })
  35. minetest.register_craft({
  36. output = 'furniture:wood_3 2',
  37. recipe = {
  38. {'default:wood'},
  39. {'default:junglewood'}
  40. }
  41. })
  42. minetest.register_craft({
  43. output = 'furniture:wood_4 2',
  44. recipe = {
  45. {'default:junglewood'},
  46. {'default:wood'}
  47. }
  48. })