commit | author | age
|
3bc6ca
|
1 |
-- Minetest 0.4.7 mod: technic |
0ca19d
|
2 |
-- namespace: technic |
R |
3 |
-- (c) 2012-2013 by RealBadAngel <mk@realbadangel.pl> |
82cba9
|
4 |
|
8e03d7
|
5 |
technic = {} |
R |
6 |
|
ee0765
|
7 |
local load_start = os.clock() |
5d470c
|
8 |
local modpath = minetest.get_modpath("technic") |
S |
9 |
technic.modpath = modpath |
|
10 |
|
be2f30
|
11 |
-- Boilerplate to support intllib + S("%s", "foo") syntax |
S |
12 |
if intllib then |
|
13 |
technic.getter = intllib.Getter() |
|
14 |
else |
|
15 |
technic.getter = function(s) return s end |
|
16 |
end |
|
17 |
local S = technic.getter |
82cba9
|
18 |
|
ee0765
|
19 |
-- Read configuration file |
82cba9
|
20 |
dofile(modpath.."/config.lua") |
ee0765
|
21 |
|
S |
22 |
-- Helper functions |
e23f87
|
23 |
dofile(modpath.."/helpers.lua") |
82cba9
|
24 |
|
ee0765
|
25 |
-- Items |
82cba9
|
26 |
dofile(modpath.."/items.lua") |
R |
27 |
|
ee0765
|
28 |
-- Craft recipes for items |
S |
29 |
dofile(modpath.."/crafts.lua") |
|
30 |
|
ee5c6c
|
31 |
-- Register functions |
ee0765
|
32 |
dofile(modpath.."/register.lua") |
ee5c6c
|
33 |
|
5d470c
|
34 |
-- Machines |
S |
35 |
dofile(modpath.."/machines/init.lua") |
82cba9
|
36 |
|
d49742
|
37 |
-- Tools |
S |
38 |
dofile(modpath.."/tools/init.lua") |
|
39 |
|
ee0765
|
40 |
-- Aliases for legacy node/item names |
S |
41 |
dofile(modpath.."/legacy.lua") |
82cba9
|
42 |
|
ee0765
|
43 |
function has_locked_chest_privilege(meta, player) |
S |
44 |
if player:get_player_name() ~= meta:get_string("owner") then |
|
45 |
return false |
|
46 |
end |
|
47 |
return true |
|
48 |
end |
82cba9
|
49 |
|
ee5c6c
|
50 |
-- Swap nodes out. Return the node name. |
ee0765
|
51 |
function hacky_swap_node(pos, name) |
S |
52 |
local node = minetest.get_node(pos) |
|
53 |
if node.name ~= name then |
|
54 |
local meta = minetest.get_meta(pos) |
|
55 |
local meta_table = meta:to_table() |
|
56 |
node.name = name |
|
57 |
minetest.set_node(pos, node) |
|
58 |
meta = minetest.get_meta(pos) |
|
59 |
meta:from_table(meta_table) |
|
60 |
end |
|
61 |
return node.name |
82cba9
|
62 |
end |
ee0765
|
63 |
|
S |
64 |
if minetest.setting_get("log_mod") then |
be2f30
|
65 |
print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start)) |
ee0765
|
66 |
end |
S |
67 |
|