forked from your-land/yl_cinema
60 lines
2.0 KiB
Lua
60 lines
2.0 KiB
Lua
-- Version 0.0.1
|
|
-- Author AliasAlreadyTaken
|
|
-- License MIT
|
|
|
|
-- Changelog
|
|
|
|
local mod_start_time = minetest.get_us_time()
|
|
minetest.log("action", "[MOD] yl_cinema loading")
|
|
|
|
yl_cinema = {}
|
|
yl_cinema.error = {}
|
|
yl_cinema.modstorage = minetest.get_mod_storage()
|
|
yl_cinema.modpath = minetest.get_modpath("yl_cinema") .. DIR_DELIM
|
|
yl_cinema.worldpath = minetest.get_worldpath() .. DIR_DELIM
|
|
|
|
yl_cinema.information = {}
|
|
yl_cinema.information.version = "0.0.1"
|
|
yl_cinema.information.author = "AliasAlreadyTaken"
|
|
yl_cinema.information.license = "MIT"
|
|
yl_cinema.information.name = "yl_cinema"
|
|
yl_cinema.information.source = "https://gitea.your-land.de/your-land/yl_cinema"
|
|
yl_cinema.information.additional = "This mod implements #9 of the Small Tasks: A way to display pictures to a player."
|
|
|
|
-- Load configuration
|
|
dofile(yl_cinema.modpath .. "config.lua")
|
|
|
|
-- Create movie path if needed
|
|
minetest.mkdir(yl_cinema.worldpath .. DIR_DELIM .. yl_cinema.settings.save_path)
|
|
|
|
-- Set up API
|
|
dofile(yl_cinema.modpath .. "api.lua")
|
|
|
|
-- Initialize features
|
|
dofile(yl_cinema.modpath .. "feature_bigscreen_items.lua")
|
|
dofile(yl_cinema.modpath .. "feature_bigscreen_entity.lua")
|
|
dofile(yl_cinema.modpath .. "feature_formspec.lua")
|
|
|
|
if minetest.get_modpath("mesecons_mvps") then
|
|
mesecon.register_mvps_stopper(yl_cinema.bigscreen_block_name)
|
|
mesecon.register_mvps_stopper(yl_cinema.flatscreen_block_name)
|
|
end
|
|
|
|
if minetest.get_modpath("replacer") and replacer and replacer.blacklist then
|
|
replacer.blacklist[yl_cinema.bigscreen_block_name] = true
|
|
replacer.blacklist[yl_cinema.flatscreen_block_name] = true
|
|
end
|
|
|
|
-- Register chatcommands
|
|
for _, filename in ipairs(minetest.get_dir_list(yl_cinema.modpath .. "/chatcommands", false)) do
|
|
if filename:sub(-4) == ".lua" then
|
|
dofile(yl_cinema.modpath .. "/chatcommands/" .. filename)
|
|
end
|
|
end
|
|
|
|
-- Load movies
|
|
minetest.after(0, yl_cinema.load_all_movies)
|
|
|
|
local mod_end_time = (minetest.get_us_time() - mod_start_time) / 1000000
|
|
minetest.log("action", "[MOD] yl_cinema loaded in [" .. mod_end_time .. "s]")
|