kpoppel
2013-07-02 053fa59739f4b772174bf0a090969b3395ab3f98
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
ee5c6c 7 technic.dprint = function(string)
K 8             if technic.DBG == 1 then
9                print(string)
10             end
11          end
12
13 local modpath=minetest.get_modpath("technic")
82cba9 14
R 15 --Read technic config file
16 dofile(modpath.."/config.lua")
e23f87 17 --helper functions
R 18 dofile(modpath.."/helpers.lua")
82cba9 19
R 20 --items 
21 dofile(modpath.."/items.lua")
22
ee5c6c 23 -- Register functions
K 24 dofile(modpath.."/register_machine_and_tool.lua")
25 dofile(modpath.."/alloy_furnaces_commons.lua") -- Idea: Let the LV, MV, HV version of the furnace support different alloys
26
27 -- Switching station LV,MV,HV
28 dofile(modpath.."/switching_station.lua")
29 dofile(modpath.."/supply_converter.lua")
30
82cba9 31 --LV machines
612349 32 dofile(modpath.."/wires.lua")
R 33 dofile(modpath.."/battery_box.lua")
82cba9 34 dofile(modpath.."/alloy_furnace.lua")
R 35 dofile(modpath.."/solar_panel.lua")
ede397 36 dofile(modpath.."/solar_array_lv.lua")
82cba9 37 dofile(modpath.."/geothermal.lua")
R 38 dofile(modpath.."/water_mill.lua")
ee5c6c 39 dofile(modpath.."/generator.lua")
82cba9 40 dofile(modpath.."/electric_furnace.lua")
R 41 dofile(modpath.."/tool_workshop.lua")
42 dofile(modpath.."/music_player.lua")
43 dofile(modpath.."/grinder.lua")
6463b7 44 dofile(modpath.."/cnc.lua")
K 45 dofile(modpath.."/cnc_api.lua")
46 dofile(modpath.."/cnc_nodes.lua")
82cba9 47
R 48 --MV machines
49 dofile(modpath.."/wires_mv.lua")
50 dofile(modpath.."/battery_box_mv.lua")
ede397 51 dofile(modpath.."/solar_array_mv.lua")
061e6b 52 dofile(modpath.."/electric_furnace_mv.lua")
5d799e 53 dofile(modpath.."/alloy_furnace_mv.lua")
ee5c6c 54 --dofile(modpath.."/forcefield.lua")
K 55 ---- The power radiator supplies appliances with inductive coupled power:
56 ---- lighting and associated textures is taken directly from VanessaE's homedecor and made electric.
37d9d9 57 dofile(modpath.."/power_radiator.lua")
K 58 dofile(modpath.."/lighting.lua")
ee5c6c 59 --
K 60 ----HV machines
6463b7 61 dofile(modpath.."/wires_hv.lua")
64207b 62 dofile(modpath.."/battery_box_hv.lua")
ede397 63 dofile(modpath.."/solar_array_hv.lua")
6463b7 64
82cba9 65 --Tools
6463b7 66 if technic.config:getBool("enable_mining_drill") then dofile(modpath.."/mining_drill.lua") end
K 67 if technic.config:getBool("enable_mining_laser") then dofile(modpath.."/mining_laser_mk1.lua") end
68 if technic.config:getBool("enable_flashlight") then dofile(modpath.."/flashlight.lua") end
82cba9 69 dofile(modpath.."/cans.lua")
R 70 dofile(modpath.."/chainsaw.lua")
71 dofile(modpath.."/tree_tap.lua")
72 dofile(modpath.."/sonic_screwdriver.lua")
ee5c6c 73 --
K 74 ---- mesecons and tubes related
74cf47 75 dofile(modpath.."/injector.lua")
82cba9 76 dofile(modpath.."/node_breaker.lua")
061e6b 77 dofile(modpath.."/deployer.lua")
82cba9 78 dofile(modpath.."/constructor.lua")
478407 79 dofile(modpath.."/frames.lua")
82cba9 80
R 81 function has_locked_chest_privilege(meta, player)
ee5c6c 82    if player:get_player_name() ~= meta:get_string("owner") then
K 83       return false
84    end
85    return true
82cba9 86 end
R 87
88
ee5c6c 89 -- Swap nodes out. Return the node name.
82cba9 90 function hacky_swap_node(pos,name)
ee5c6c 91    local node = minetest.env:get_node(pos)
K 92    if node.name ~= name then
93       local meta = minetest.env:get_meta(pos)
94       local meta0 = meta:to_table()
95       node.name = name
96       minetest.env:set_node(pos,node)
97       meta = minetest.env:get_meta(pos)
98       meta:from_table(meta0)
99    end
100    return node.name
82cba9 101 end