Update depends (#11)

I added `wool` in depends and `cottages` in optional_depends.
Craft using `cottages`’s items are now registered only when `cottages`
is loaded.
This commit is contained in:
Louis Royer 2020-02-15 22:34:12 +01:00 committed by GitHub
parent d67d7a34c8
commit 349b508d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 20 deletions

View File

@ -13,6 +13,8 @@ else
end end
-- cottages support
local use_cottages = minetest.get_modpath("cottages")
local tapestry = {} local tapestry = {}
@ -142,35 +144,37 @@ minetest.register_craft({
recipe = {'wool:white', 'default:stick'}, recipe = {'wool:white', 'default:stick'},
}) })
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry',
recipe = {'cottages:wool', 'default:stick'},
})
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = 'castle_tapestries:tapestry_long', output = 'castle_tapestries:tapestry_long',
recipe = {'wool:white', 'castle_tapestries:tapestry'}, recipe = {'wool:white', 'castle_tapestries:tapestry'},
}) })
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry_long',
recipe = {'cottages:wool', 'castle_tapestries:tapestry'},
})
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = 'castle_tapestries:tapestry_very_long', output = 'castle_tapestries:tapestry_very_long',
recipe = {'wool:white', 'castle_tapestries:tapestry_long'}, recipe = {'wool:white', 'castle_tapestries:tapestry_long'},
}) })
minetest.register_craft({ if use_cottages then
type = "shapeless", minetest.register_craft({
output = 'castle_tapestries:tapestry_very_long', type = "shapeless",
recipe = {'cottages:wool', 'castle_tapestries:tapestry_long'}, output = 'castle_tapestries:tapestry',
}) recipe = {'cottages:wool', 'default:stick'},
})
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry_long',
recipe = {'cottages:wool', 'castle_tapestries:tapestry'},
})
minetest.register_craft({
type = "shapeless",
output = 'castle_tapestries:tapestry_very_long',
recipe = {'cottages:wool', 'castle_tapestries:tapestry_long'},
})
end
unifieddyes.register_color_craft({ unifieddyes.register_color_craft({

View File

@ -1,4 +1,4 @@
name = castle_tapestries name = castle_tapestries
depends = default, unifieddyes depends = default, unifieddyes, wool
optional_depends = intllib optional_depends = intllib, cottages
description = This is a mod for creating medieval tapestries, as found in castles. description = This is a mod for creating medieval tapestries, as found in castles.