forked from your-land/yl_cinema
49 lines
1.3 KiB
Lua
49 lines
1.3 KiB
Lua
if yl_cinema.settings.enable_movieitems ~= true then
|
|
return
|
|
end
|
|
|
|
-- Empty reel
|
|
|
|
yl_cinema.movie_item_name_empty = "yl_cinema:movie_reel"
|
|
local movie_item_definition_empty = {
|
|
groups = {
|
|
movie = 1,
|
|
media = 1
|
|
},
|
|
inventory_image = "yl_cinema_icon_movie_empty_inv.png",
|
|
wield_image = "yl_cinema_icon_movie_empty_inv.png",
|
|
}
|
|
|
|
minetest.register_craftitem(yl_cinema.movie_item_name_empty, movie_item_definition_empty)
|
|
|
|
-- Written reel
|
|
|
|
yl_cinema.movie_item_name_written = "yl_cinema:movie_print"
|
|
local movie_item_definition = {
|
|
groups = {
|
|
movie = 1,
|
|
not_in_creative_inventory = 1,
|
|
media = 1
|
|
},
|
|
inventory_image = "yl_cinema_icon_movie_inv.png",
|
|
wield_image = "yl_cinema_icon_movie_inv.png",
|
|
stack_max = 1,
|
|
}
|
|
|
|
minetest.register_craftitem(yl_cinema.movie_item_name_written, movie_item_definition)
|
|
|
|
-- Craft the empty reel
|
|
|
|
local recipe = yl_cinema.string_to_recipe(yl_cinema.settings.enable_craft_moviereel_recipe)
|
|
|
|
if type(recipe) == "table" then
|
|
minetest.register_craft({
|
|
type = "shaped",
|
|
output = yl_cinema.movie_item_name_empty,
|
|
recipe = recipe
|
|
})
|
|
else
|
|
yl_cinema.warn("Cannot register crafting recipe for Reel Item: " ..
|
|
dump(yl_cinema.settings.enable_craft_moviereel_recipe))
|
|
end
|