init.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --if not minetest.is_singleplayer() then return end
  2. castle_masonry = {}
  3. local MP = minetest.get_modpath(minetest.get_current_modname())
  4. dofile(MP.."/stone_wall.lua")
  5. dofile(MP.."/paving.lua")
  6. local S, NS = dofile(MP.."/intllib.lua")
  7. local read_setting = function(name, default)
  8. local setting = minetest.settings:get_bool(name)
  9. if setting == nil then return default end
  10. return setting
  11. end
  12. castle_masonry.get_material_properties = function(material)
  13. local composition_def
  14. local burn_time
  15. if material.composition_material ~= nil then
  16. composition_def = minetest.registered_nodes[material.composition_material]
  17. burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.composition_material)}}).time
  18. else
  19. composition_def = minetest.registered_nodes[material.craft_material]
  20. burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack(material.craft_materia)}}).time
  21. end
  22. local tiles = material.tile
  23. if tiles == nil then
  24. tiles = composition_def.tile
  25. elseif type(tiles) == "string" then
  26. tiles = {tiles}
  27. end
  28. local desc = material.desc
  29. if desc == nil then
  30. desc = composition_def.description
  31. end
  32. return composition_def, burn_time, tiles, desc
  33. end