forked from your-land/yl_cinema
25 lines
986 B
Lua
25 lines
986 B
Lua
if yl_cinema.settings.enable_movieitems ~= true then return end
|
|
|
|
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,
|
|
range = 4,
|
|
liquids_pointable = false
|
|
}
|
|
|
|
for movie_id, movie in pairs(yl_cinema.movies) do
|
|
if movie.item and (movie.item == true) then
|
|
local item_definition = movie_item_definition
|
|
item_definition._yl_cinema_movie_id = movie_id
|
|
core.log("action", "item_definition._yl_cinema_movie_id=" ..
|
|
item_definition._yl_cinema_movie_id)
|
|
item_definition.short_description = minetest.formspec_escape(movie.name)
|
|
item_definition.description =
|
|
minetest.formspec_escape(movie.description)
|
|
local item_string = yl_cinema.get_itemstring(movie_id)
|
|
minetest.register_craftitem(item_string, item_definition)
|
|
end
|
|
end
|