ExchangeClone/exchangeclone/init.lua

163 lines
3.3 KiB
Lua
Raw Normal View History

2023-12-15 00:09:59 +01:00
if not exchangeclone then
2023-11-10 03:35:23 +01:00
error("Disable and re-enable the ExchangeClone modpack.")
end
2023-11-03 00:53:52 +01:00
local start_time = minetest.get_us_time()
minetest.log("action", "[ExchangeClone] Registering own stuff")
2023-09-29 01:23:49 +02:00
2023-12-15 00:09:59 +01:00
-- Decides what mod to use for sounds
exchangeclone.sound_mod = exchangeclone.mcl and mcl_sounds or default
2023-09-12 16:46:59 +02:00
2023-09-29 01:23:49 +02:00
local modpath = minetest.get_modpath("exchangeclone")
2021-08-25 18:01:36 +02:00
2023-12-18 23:57:30 +01:00
exchangeclone.colors = {}
if exchangeclone.mcl then
-- I finally found a good place to get color data in both games.
for unicolor, data in pairs(mcl_banners.colors) do
if not exchangeclone.colors[data[1]] then
exchangeclone.colors[data[1]] = {
name = data[6],
hex = data[4],
dye = data[5],
}
end
end
else
-- color hex values taken from MCLA
exchangeclone.colors = {
white = {
name = "White",
hex = "#d0d6d7",
dye = "dye:white",
},
grey = {
name = "Grey",
hex = "#818177",
dye = "dye:grey",
},
dark_grey = {
name = "Dark Grey",
hex = "#383c40",
dye = "dye:dark_grey",
},
black = {
name = "Black",
hex = "#080a10",
dye = "dye:black",
},
violet = {
name = "Violet",
hex = "#6821a0",
dye = "dye:violet",
},
blue = {
name = "Blue",
hex = "#2e3094",
dye = "dye:blue",
},
cyan = {
name = "Cyan",
hex = "#167b8c",
dye = "dye:cyan",
},
dark_green = {
name = "Dark Green",
hex = "#4b5e25",
dye = "dye:dark_green",
},
green = {
name = "Green",
hex = "#60ac19",
dye = "dye:green",
},
yellow = {
name = "Yellow",
hex = "#f1b216",
dye = "dye:yellow",
},
brown = {
name = "Brown",
hex = "#633d20",
dye = "dye:brown",
},
orange = {
name = "Orange",
hex = "#e26501",
dye = "dye:orange",
},
red = {
name = "Red",
hex = "#912222",
dye = "dye:red",
},
magenta = {
name = "Magenta",
hex = "#ab31a2",
dye = "dye:magenta",
},
pink = {
name = "Pink",
hex = "#d56791",
dye = "dye:pink",
},
}
end
2024-01-11 02:01:21 +01:00
if exchangeclone.mcl2 then
mcl_item_id.set_mod_namespace("exchangeclone")
end
2024-02-16 22:44:08 +01:00
local files = {
"constructor",
"deconstructor",
"energy_collector",
"klein_stars",
"craftitems",
"tool_upgrades",
"swords",
"pickaxes",
"axes",
"shovels",
"hoes",
"hammers",
"red_matter_multitools",
"covalence_dust",
"philosophers_stone",
"infinite_food",
"alchemical_chests",
"transmutation_table",
"furnaces",
"gem_of_eternal_density",
"talisman_of_repair",
"passive_stones",
}
2024-01-11 02:01:21 +01:00
2023-09-29 01:23:49 +02:00
if exchangeclone.mcl or minetest.get_modpath("3d_armor") then
dofile(modpath.."/armor.lua")
2023-08-07 22:56:29 +02:00
end
2024-02-16 22:44:08 +01:00
2024-01-11 02:01:21 +01:00
if exchangeclone.mcl then
2023-09-29 01:23:49 +02:00
dofile(modpath.."/shears.lua")
2023-11-13 02:30:16 +01:00
dofile(modpath.."/tool_upgrades.lua")
end
2024-02-16 22:44:08 +01:00
2023-11-13 02:30:16 +01:00
if minetest.get_modpath("hopper") then
dofile(modpath.."/hopper_compat.lua")
2023-10-07 17:26:21 +02:00
end
2024-02-16 22:44:08 +01:00
2024-02-13 22:33:56 +01:00
if minetest.get_modpath("awards") then
dofile(modpath.."/awards.lua")
end
2023-11-20 01:01:56 +01:00
2024-02-16 22:44:08 +01:00
for _, file in ipairs(files) do
dofile(modpath.."/"..file..".lua")
end
2023-12-15 00:09:59 +01:00
minetest.register_on_mods_loaded(function()
local emc_start_time = minetest.get_us_time()
minetest.log("action", "[ExchangeClone] Registering EMC values")
dofile(modpath.."/register_emc.lua")
minetest.log("action", "[ExchangeClone] Done registering EMC values ("..((minetest.get_us_time() - emc_start_time)/1000000).." seconds)")
end)
minetest.log("action", "[ExchangeClone] Done ("..((minetest.get_us_time() - start_time)/1000).." milliseconds)")