forked from coil0/replacer
-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.lua
86 lines (74 loc) · 3.16 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
--[[
Replacement tool for creative building (Mod for MineTest)
Copyright (C) 2013 Sokomine
Copyright (C) 2019 coil0
Copyright (C) 2019 HybridDog
Copyright (C) 2019-2024 SwissalpS
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
-- Version 4.93 (20240803)
-- Changelog: see CHANGELOG file
replacer = {}
replacer.version = 20240803
replacer.has_bakedclay = minetest.get_modpath('bakedclay')
replacer.has_basic_dyes = minetest.get_modpath('dye')
and minetest.global_exists('dye')
and dye.basecolors and true or false
replacer.has_circular_saw = minetest.get_modpath('moreblocks')
and minetest.global_exists('moreblocks')
and minetest.global_exists('circular_saw')
and circular_saw.names and true or false
replacer.has_colormachine_mod = minetest.get_modpath('colormachine')
and minetest.global_exists('colormachine')
replacer.has_technic_mod = minetest.get_modpath('technic')
and minetest.global_exists('technic')
replacer.has_unifieddyes_mod = minetest.get_modpath('unifieddyes')
and minetest.global_exists('unifieddyes')
replacer.has_unified_inventory_mod = minetest.get_modpath('unified_inventory')
and true or false
replacer.has_xcompat_mod = minetest.get_modpath('xcompat')
and minetest.global_exists('xcompat')
-- image mapping tables for replacer:inspect
replacer.group_placeholder = {}
replacer.image_replacements = {}
local path = minetest.get_modpath('replacer') .. '/'
-- for developers
dofile(path .. 'test.lua')
-- strings for translation (inspect & replacer)
dofile(path .. 'blabla.lua')
-- utilities (inspect & replacer)
-- material and sound compatibility for various games
dofile(path .. 'xcompat.lua')
dofile(path .. 'utils.lua')
-- more settings and functions
dofile(path .. 'replacer/constrain.lua')
-- register set enable functions
dofile(path .. 'replacer/enable.lua')
-- adds a tool for inspecting nodes and entities
dofile(path .. 'inspect.lua')
-- loop through compat dir
local path_compat = path .. 'compat/'
for _, file in ipairs(minetest.get_dir_list(path_compat, false)) do
if file:find('^[^._].+[.]lua$') then
dofile(path_compat .. file)
end
end
replacer.datastructures = dofile(path .. 'replacer/datastructures.lua')
dofile(path .. 'replacer/formspecs.lua')
dofile(path .. 'replacer/history.lua')
dofile(path .. 'replacer/patterns.lua')
dofile(path .. 'replacer/replacer.lua')
dofile(path .. 'crafts.lua')
dofile(path .. 'chat_commands.lua')
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
print('[replacer] loaded')