ShadowNinja
2013-04-26 00328622d9cc38a7768a7bf449f5c52ddba666f7
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
003286 5 technic = {}
S 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")
30
31 --MV machines
32 dofile(modpath.."/wires_mv.lua")
33 dofile(modpath.."/battery_box_mv.lua")
612349 34 dofile(modpath.."/solar_panel_mv.lua")
061e6b 35 dofile(modpath.."/electric_furnace_mv.lua")
5d799e 36 dofile(modpath.."/alloy_furnace_mv.lua")
c6da0a 37 dofile(modpath.."/forcefield.lua")
82cba9 38
31b139 39 --HV machines
R 40 dofile(modpath.."/wires_hv.lua")
41
82cba9 42 --Tools
003286 43 if technic.config:getBool("enable_mining_drill") then dofile(modpath.."/mining_drill.lua") end
S 44 if technic.config:getBool("enable_mining_laser") then dofile(modpath.."/mining_laser_mk1.lua") end
45 if technic.config:getBool("enable_flashlight") then dofile(modpath.."/flashlight.lua") end
82cba9 46 dofile(modpath.."/cans.lua")
R 47 dofile(modpath.."/chainsaw.lua")
48 dofile(modpath.."/tree_tap.lua")
49 dofile(modpath.."/sonic_screwdriver.lua")
50
51 -- mesecons and tubes related
74cf47 52 dofile(modpath.."/injector.lua")
82cba9 53 dofile(modpath.."/node_breaker.lua")
061e6b 54 dofile(modpath.."/deployer.lua")
82cba9 55 dofile(modpath.."/constructor.lua")
478407 56 dofile(modpath.."/frames.lua")
82cba9 57
R 58 function has_locked_chest_privilege(meta, player)
59     if player:get_player_name() ~= meta:get_string("owner") then
60         return false
61     end
62     return true
63 end
64
65
66 function hacky_swap_node(pos,name)
67     local node = minetest.env:get_node(pos)
68     local meta = minetest.env:get_meta(pos)
69     local meta0 = meta:to_table()
70     if node.name == name then
71         return nil
72     end
73     node.name = name
74     local meta0 = meta:to_table()
75     minetest.env:set_node(pos,node)
76     meta = minetest.env:get_meta(pos)
77     meta:from_table(meta0)
78     return 1
79 end