kpoppel
2013-06-03 ceb8a71f27b45c304ce2626cc4f939a52323b192
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")
ede397 23 dofile(modpath.."/solar_array_lv.lua")
82cba9 24 dofile(modpath.."/geothermal.lua")
R 25 dofile(modpath.."/water_mill.lua")
26 dofile(modpath.."/electric_furnace.lua")
27 dofile(modpath.."/tool_workshop.lua")
28 dofile(modpath.."/music_player.lua")
29 dofile(modpath.."/generator.lua")
30 dofile(modpath.."/grinder.lua")
6463b7 31 dofile(modpath.."/cnc.lua")
K 32 dofile(modpath.."/cnc_api.lua")
33 dofile(modpath.."/cnc_nodes.lua")
82cba9 34
R 35 --MV machines
36 dofile(modpath.."/wires_mv.lua")
37 dofile(modpath.."/battery_box_mv.lua")
ede397 38 dofile(modpath.."/solar_array_mv.lua")
061e6b 39 dofile(modpath.."/electric_furnace_mv.lua")
5d799e 40 dofile(modpath.."/alloy_furnace_mv.lua")
c6da0a 41 dofile(modpath.."/forcefield.lua")
82cba9 42
6463b7 43 --HV machines
K 44 dofile(modpath.."/wires_hv.lua")
64207b 45 dofile(modpath.."/battery_box_hv.lua")
ede397 46 dofile(modpath.."/solar_array_hv.lua")
6463b7 47
82cba9 48 --Tools
6463b7 49 if technic.config:getBool("enable_mining_drill") then dofile(modpath.."/mining_drill.lua") end
K 50 if technic.config:getBool("enable_mining_laser") then dofile(modpath.."/mining_laser_mk1.lua") end
51 if technic.config:getBool("enable_flashlight") then dofile(modpath.."/flashlight.lua") end
82cba9 52 dofile(modpath.."/cans.lua")
R 53 dofile(modpath.."/chainsaw.lua")
54 dofile(modpath.."/tree_tap.lua")
55 dofile(modpath.."/sonic_screwdriver.lua")
56
57 -- mesecons and tubes related
74cf47 58 dofile(modpath.."/injector.lua")
82cba9 59 dofile(modpath.."/node_breaker.lua")
061e6b 60 dofile(modpath.."/deployer.lua")
82cba9 61 dofile(modpath.."/constructor.lua")
478407 62 dofile(modpath.."/frames.lua")
82cba9 63
R 64 function has_locked_chest_privilege(meta, player)
65     if player:get_player_name() ~= meta:get_string("owner") then
66         return false
67     end
68     return true
69 end
70
71
72 function hacky_swap_node(pos,name)
73     local node = minetest.env:get_node(pos)
74     local meta = minetest.env:get_meta(pos)
75     local meta0 = meta:to_table()
76     if node.name == name then
77         return nil
78     end
79     node.name = name
80     local meta0 = meta:to_table()
81     minetest.env:set_node(pos,node)
82     meta = minetest.env:get_meta(pos)
83     meta:from_table(meta0)
84     return 1
85 end