kpoppel
2013-06-19 37d9d94c44cbadc7e6550efc22612c7c605a9040
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")
37d9d9 43 -- These two are a concept study: Supplying appliances with inductive coupled power:
K 44 -- lighting and associated textures is taken directly from VanessaE's homedecor and made electric.
45 dofile(modpath.."/power_radiator.lua")
46 dofile(modpath.."/lighting.lua")
82cba9 47
6463b7 48 --HV machines
K 49 dofile(modpath.."/wires_hv.lua")
64207b 50 dofile(modpath.."/battery_box_hv.lua")
ede397 51 dofile(modpath.."/solar_array_hv.lua")
cfb5bd 52 dofile(modpath.."/down_converter_hv.lua")
6463b7 53
82cba9 54 --Tools
6463b7 55 if technic.config:getBool("enable_mining_drill") then dofile(modpath.."/mining_drill.lua") end
K 56 if technic.config:getBool("enable_mining_laser") then dofile(modpath.."/mining_laser_mk1.lua") end
57 if technic.config:getBool("enable_flashlight") then dofile(modpath.."/flashlight.lua") end
82cba9 58 dofile(modpath.."/cans.lua")
R 59 dofile(modpath.."/chainsaw.lua")
60 dofile(modpath.."/tree_tap.lua")
61 dofile(modpath.."/sonic_screwdriver.lua")
62
63 -- mesecons and tubes related
74cf47 64 dofile(modpath.."/injector.lua")
82cba9 65 dofile(modpath.."/node_breaker.lua")
061e6b 66 dofile(modpath.."/deployer.lua")
82cba9 67 dofile(modpath.."/constructor.lua")
478407 68 dofile(modpath.."/frames.lua")
82cba9 69
R 70 function has_locked_chest_privilege(meta, player)
71     if player:get_player_name() ~= meta:get_string("owner") then
72         return false
73     end
74     return true
75 end
76
77
78 function hacky_swap_node(pos,name)
79     local node = minetest.env:get_node(pos)
80     local meta = minetest.env:get_meta(pos)
81     local meta0 = meta:to_table()
82     if node.name == name then
83         return nil
84     end
85     node.name = name
86     local meta0 = meta:to_table()
87     minetest.env:set_node(pos,node)
88     meta = minetest.env:get_meta(pos)
89     meta:from_table(meta0)
90     return 1
91 end