kpoppel
2013-06-18 467dcf1d5d2daccde8fe5cfb45317482fe004cc3
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")
cfb5bd 39 dofile(modpath.."/down_converter_mv.lua")
061e6b 40 dofile(modpath.."/electric_furnace_mv.lua")
5d799e 41 dofile(modpath.."/alloy_furnace_mv.lua")
c6da0a 42 dofile(modpath.."/forcefield.lua")
82cba9 43
6463b7 44 --HV machines
K 45 dofile(modpath.."/wires_hv.lua")
64207b 46 dofile(modpath.."/battery_box_hv.lua")
ede397 47 dofile(modpath.."/solar_array_hv.lua")
cfb5bd 48 dofile(modpath.."/down_converter_hv.lua")
6463b7 49
82cba9 50 --Tools
6463b7 51 if technic.config:getBool("enable_mining_drill") then dofile(modpath.."/mining_drill.lua") end
K 52 if technic.config:getBool("enable_mining_laser") then dofile(modpath.."/mining_laser_mk1.lua") end
53 if technic.config:getBool("enable_flashlight") then dofile(modpath.."/flashlight.lua") end
82cba9 54 dofile(modpath.."/cans.lua")
R 55 dofile(modpath.."/chainsaw.lua")
56 dofile(modpath.."/tree_tap.lua")
57 dofile(modpath.."/sonic_screwdriver.lua")
58
59 -- mesecons and tubes related
74cf47 60 dofile(modpath.."/injector.lua")
82cba9 61 dofile(modpath.."/node_breaker.lua")
061e6b 62 dofile(modpath.."/deployer.lua")
82cba9 63 dofile(modpath.."/constructor.lua")
478407 64 dofile(modpath.."/frames.lua")
82cba9 65
R 66 function has_locked_chest_privilege(meta, player)
67     if player:get_player_name() ~= meta:get_string("owner") then
68         return false
69     end
70     return true
71 end
72
73
74 function hacky_swap_node(pos,name)
75     local node = minetest.env:get_node(pos)
76     local meta = minetest.env:get_meta(pos)
77     local meta0 = meta:to_table()
78     if node.name == name then
79         return nil
80     end
81     node.name = name
82     local meta0 = meta:to_table()
83     minetest.env:set_node(pos,node)
84     meta = minetest.env:get_meta(pos)
85     meta:from_table(meta0)
86     return 1
87 end