ExchangeClone/exchangeclone/init.lua

147 lines
3.4 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
2023-09-29 01:23:49 +02:00
dofile(modpath.."/constructor.lua")
dofile(modpath.."/deconstructor.lua")
dofile(modpath.."/energy_collector.lua")
2024-02-12 19:02:52 +01:00
dofile(modpath.."/klein_stars.lua")
2023-09-29 01:23:49 +02:00
dofile(modpath.."/craftitems.lua")
if exchangeclone.mcl or minetest.get_modpath("3d_armor") then
dofile(modpath.."/armor.lua")
2023-08-07 22:56:29 +02:00
end
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
2023-09-29 01:23:49 +02:00
dofile(modpath.."/swords.lua")
dofile(modpath.."/axes.lua")
dofile(modpath.."/hoes.lua")
dofile(modpath.."/pickaxes.lua")
dofile(modpath.."/hammers.lua")
dofile(modpath.."/shovels.lua")
dofile(modpath.."/red_matter_multitools.lua")
2023-11-19 01:48:35 +01:00
dofile(modpath.."/covalence_dust.lua")
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
2023-09-29 01:23:49 +02:00
dofile(modpath.."/philosophers_stone.lua")
2023-11-08 01:02:24 +01:00
dofile(modpath.."/infinite_food.lua")
2023-11-19 01:48:35 +01:00
dofile(modpath.."/alchemical_chests.lua")
2023-10-04 02:07:36 +02:00
dofile(modpath.."/transmutation_table.lua")
2023-11-20 01:01:56 +01:00
dofile(modpath.."/furnaces.lua")
2023-12-15 00:09:59 +01:00
minetest.register_on_mods_loaded(function()
local energy_start_time = minetest.get_us_time()
minetest.log("action", "[ExchangeClone] Registering energy values")
2023-12-15 00:09:59 +01:00
dofile(modpath.."/register_energy.lua")
minetest.log("action", "[ExchangeClone] Done registering energy values ("..((minetest.get_us_time() - energy_start_time)/1000000).." seconds)")
end)
minetest.log("action", "[ExchangeClone] Done ("..((minetest.get_us_time() - start_time)/1000).." milliseconds)")