init.lua 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. -- Version: 2.2
  2. -- Autor: Sokomine
  3. -- License: GPLv3
  4. --
  5. -- Modified:
  6. -- 11.03.19 Adjustments for MT 5.x
  7. -- cottages_feldweg_mode is now a setting in minetest.conf
  8. -- 27.07.15 Moved into its own repository.
  9. -- Made sure textures and craft receipe indigrents are available or can be replaced.
  10. -- Took care of "unregistered globals" warnings.
  11. -- 23.01.14 Added conversion receipes in case of installed castle-mod (has its own anvil)
  12. -- 23.01.14 Added hammer and anvil as decoration and for repairing tools.
  13. -- Added hatches (wood and steel).
  14. -- Changed the texture of the fence/handrail.
  15. -- 17.01.13 Added alternate receipe for fences in case of interference due to xfences
  16. -- 14.01.13 Added alternate receipes for roof parts in case homedecor is not installed.
  17. -- Added receipe for stove pipe, tub and barrel.
  18. -- Added stairs/slabs for dirt road, loam and clay
  19. -- Added fence_small, fence_corner and fence_end, which are useful as handrails and fences
  20. -- If two or more window shutters are placed above each other, they will now all close/open simultaneously.
  21. -- Added threshing floor.
  22. -- Added hand-driven mill.
  23. cottages = {}
  24. -- Boilerplate to support localized strings if intllib mod is installed.
  25. if minetest.get_modpath( "intllib" ) and intllib then
  26. cottages.S = intllib.Getter()
  27. else
  28. cottages.S = function(s) return s end
  29. end
  30. cottages.sounds = {}
  31. -- MineClone2 needs special treatment; default is only needed for
  32. -- crafting materials and sounds (less important)
  33. if( not( minetest.get_modpath("default"))) then
  34. default = {};
  35. cottages.sounds.wood = nil
  36. cottages.sounds.dirt = nil
  37. cottages.sounds.leaves = nil
  38. cottages.sounds.stone = nil
  39. else
  40. cottages.sounds.wood = default.node_sound_wood_defaults()
  41. cottages.sounds.dirt = default.node_sound_dirt_defaults()
  42. cottages.sounds.stone = default.node_sound_stone_defaults()
  43. cottages.sounds.leaves = default.node_sound_leaves_defaults()
  44. end
  45. -- the straw from default comes with stairs as well and might replace
  46. -- cottages:roof_connector_straw and cottages:roof_flat_straw
  47. -- however, that does not look very good
  48. if( false and minetest.registered_nodes["farming:straw"]) then
  49. cottages.straw_texture = "farming_straw.png"
  50. cottages.use_farming_straw_stairs = true
  51. else
  52. cottages.straw_texture = "cottages_darkage_straw.png"
  53. end
  54. --cottages.config_use_mesh_barrel = false;
  55. --cottages.config_use_mesh_handmill = true;
  56. -- set alternate crafting materials and textures where needed
  57. -- (i.e. in combination with realtest)
  58. dofile(minetest.get_modpath("cottages").."/adaptions.lua");
  59. -- add to this table what you want the handmill to convert;
  60. -- add a stack size if you want a higher yield
  61. cottages.handmill_product = {};
  62. cottages.handmill_product[ cottages.craftitem_seed_wheat ] = 'farming:flour 1';
  63. --[[ some examples:
  64. cottages.handmill_product[ 'default:cobble' ] = 'default:gravel';
  65. cottages.handmill_product[ 'default:gravel' ] = 'default:sand';
  66. cottages.handmill_product[ 'default:sand' ] = 'default:dirt 2';
  67. cottages.handmill_product[ 'flowers:rose' ] = 'dye:red 6';
  68. cottages.handmill_product[ 'default:cactus' ] = 'dye:green 6';
  69. cottages.handmill_product[ 'default:coal_lump'] = 'dye:black 6';
  70. --]]
  71. -- process that many inputs per turn
  72. cottages.handmill_max_per_turn = 20;
  73. cottages.handmill_min_per_turn = 0;
  74. dofile(minetest.get_modpath("cottages").."/functions.lua");
  75. -- uncomment parts you do not want
  76. dofile(minetest.get_modpath("cottages").."/nodes_furniture.lua");
  77. dofile(minetest.get_modpath("cottages").."/nodes_historic.lua");
  78. dofile(minetest.get_modpath("cottages").."/nodes_feldweg.lua");
  79. -- allows to dig hay and straw fast
  80. dofile(minetest.get_modpath("cottages").."/nodes_pitchfork.lua");
  81. dofile(minetest.get_modpath("cottages").."/nodes_straw.lua");
  82. dofile(minetest.get_modpath("cottages").."/nodes_hay.lua");
  83. dofile(minetest.get_modpath("cottages").."/nodes_anvil.lua");
  84. dofile(minetest.get_modpath("cottages").."/nodes_doorlike.lua");
  85. dofile(minetest.get_modpath("cottages").."/nodes_fences.lua");
  86. dofile(minetest.get_modpath("cottages").."/nodes_roof.lua");
  87. dofile(minetest.get_modpath("cottages").."/nodes_barrel.lua");
  88. dofile(minetest.get_modpath("cottages").."/nodes_mining.lua");
  89. dofile(minetest.get_modpath("cottages").."/nodes_water.lua");
  90. --dofile(minetest.get_modpath("cottages").."/nodes_chests.lua");
  91. -- this is only required and useful if you run versions of the random_buildings mod where the nodes where defined inside that mod
  92. dofile(minetest.get_modpath("cottages").."/alias.lua");
  93. -- variable no longer needed
  94. cottages.S = nil;