RealBadAngel
2013-05-30 7d890428f547758ffd907252b2effb1d743c02e4
commit | author | age
0ca19d 1 -- Minetest 0.4.6 mod: technic
R 2 -- namespace: technic
3 -- (c) 2012-2013 by RealBadAngel <mk@realbadangel.pl>
82cba9 4
6463b7 5 technic = {}
K 6
82cba9 7 modpath=minetest.get_modpath("technic")
R 8
9 --Read technic config file
10 dofile(modpath.."/config.lua")
e23f87 11 --helper functions
R 12 dofile(modpath.."/helpers.lua")
82cba9 13
R 14 --items 
15 dofile(modpath.."/items.lua")
16
17 --LV machines
612349 18 dofile(modpath.."/wires.lua")
R 19 dofile(modpath.."/battery_box.lua")
5d799e 20 dofile(modpath.."/alloy_furnaces_commons.lua")
82cba9 21 dofile(modpath.."/alloy_furnace.lua")
R 22 dofile(modpath.."/solar_panel.lua")
23 dofile(modpath.."/geothermal.lua")
24 dofile(modpath.."/water_mill.lua")
25 dofile(modpath.."/electric_furnace.lua")
26 dofile(modpath.."/tool_workshop.lua")
27 dofile(modpath.."/music_player.lua")
28 dofile(modpath.."/generator.lua")
29 dofile(modpath.."/grinder.lua")
6463b7 30 dofile(modpath.."/cnc.lua")
K 31 dofile(modpath.."/cnc_api.lua")
32 dofile(modpath.."/cnc_nodes.lua")
82cba9 33
R 34 --MV machines
35 dofile(modpath.."/wires_mv.lua")
36 dofile(modpath.."/battery_box_mv.lua")
612349 37 dofile(modpath.."/solar_panel_mv.lua")
061e6b 38 dofile(modpath.."/electric_furnace_mv.lua")
5d799e 39 dofile(modpath.."/alloy_furnace_mv.lua")
c6da0a 40 dofile(modpath.."/forcefield.lua")
82cba9 41
6463b7 42 --HV machines
K 43 dofile(modpath.."/wires_hv.lua")
64207b 44 dofile(modpath.."/battery_box_hv.lua")
6463b7 45
82cba9 46 --Tools
6463b7 47 if technic.config:getBool("enable_mining_drill") then dofile(modpath.."/mining_drill.lua") end
K 48 if technic.config:getBool("enable_mining_laser") then dofile(modpath.."/mining_laser_mk1.lua") end
49 if technic.config:getBool("enable_flashlight") then dofile(modpath.."/flashlight.lua") end
82cba9 50 dofile(modpath.."/cans.lua")
R 51 dofile(modpath.."/chainsaw.lua")
52 dofile(modpath.."/tree_tap.lua")
53 dofile(modpath.."/sonic_screwdriver.lua")
54
55 -- mesecons and tubes related
74cf47 56 dofile(modpath.."/injector.lua")
82cba9 57 dofile(modpath.."/node_breaker.lua")
061e6b 58 dofile(modpath.."/deployer.lua")
82cba9 59 dofile(modpath.."/constructor.lua")
478407 60 dofile(modpath.."/frames.lua")
82cba9 61
R 62 function has_locked_chest_privilege(meta, player)
63     if player:get_player_name() ~= meta:get_string("owner") then
64         return false
65     end
66     return true
67 end
68
69
70 function hacky_swap_node(pos,name)
71     local node = minetest.env:get_node(pos)
72     local meta = minetest.env:get_meta(pos)
73     local meta0 = meta:to_table()
74     if node.name == name then
75         return nil
76     end
77     node.name = name
78     local meta0 = meta:to_table()
79     minetest.env:set_node(pos,node)
80     meta = minetest.env:get_meta(pos)
81     meta:from_table(meta0)
82     return 1
83 end