RealBadAngel
2013-07-17 3bc6cad6710ad76f8a829a575f03fea00c589134
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
5d470c 7 local modpath = minetest.get_modpath("technic")
S 8
9 technic.modpath = modpath
10
ee5c6c 11 technic.dprint = function(string)
19c9a0 12     if technic.DBG == 1 then
S 13         print(string)
14     end
15 end
82cba9 16
R 17 --Read technic config file
18 dofile(modpath.."/config.lua")
e23f87 19 --helper functions
R 20 dofile(modpath.."/helpers.lua")
82cba9 21
R 22 --items 
23 dofile(modpath.."/items.lua")
24
ee5c6c 25 -- Register functions
K 26 dofile(modpath.."/register_machine_and_tool.lua")
27
5d470c 28 -- Machines
S 29 dofile(modpath.."/machines/init.lua")
82cba9 30
d49742 31 -- Tools
S 32 dofile(modpath.."/tools/init.lua")
33
82cba9 34 function has_locked_chest_privilege(meta, player)
ee5c6c 35    if player:get_player_name() ~= meta:get_string("owner") then
K 36       return false
37    end
38    return true
82cba9 39 end
R 40
41
ee5c6c 42 -- Swap nodes out. Return the node name.
82cba9 43 function hacky_swap_node(pos,name)
ee5c6c 44    local node = minetest.env:get_node(pos)
K 45    if node.name ~= name then
46       local meta = minetest.env:get_meta(pos)
47       local meta0 = meta:to_table()
48       node.name = name
49       minetest.env:set_node(pos,node)
50       meta = minetest.env:get_meta(pos)
51       meta:from_table(meta0)
52    end
53    return node.name
82cba9 54 end