RealBadAngel
2013-04-04 0ca19dacb03a0d33de34a2dabf921ba7c9cb5b25
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
R 5 modpath=minetest.get_modpath("technic")
6
7 --Read technic config file
8 dofile(modpath.."/config.lua")
e23f87 9 --helper functions
R 10 dofile(modpath.."/helpers.lua")
82cba9 11
R 12 -- chests
13 dofile(modpath.."/chest_commons.lua")
14 dofile(modpath.."/iron_chest.lua")
15 dofile(modpath.."/copper_chest.lua")
16 dofile(modpath.."/silver_chest.lua")
17 dofile(modpath.."/gold_chest.lua")
18 dofile(modpath.."/mithril_chest.lua")
19
20 --items 
21 dofile(modpath.."/items.lua")
22
23 --LV machines
612349 24 dofile(modpath.."/wires.lua")
R 25 dofile(modpath.."/battery_box.lua")
5d799e 26 dofile(modpath.."/alloy_furnaces_commons.lua")
82cba9 27 dofile(modpath.."/alloy_furnace.lua")
R 28 dofile(modpath.."/solar_panel.lua")
29 dofile(modpath.."/geothermal.lua")
30 dofile(modpath.."/water_mill.lua")
31 dofile(modpath.."/electric_furnace.lua")
32 dofile(modpath.."/tool_workshop.lua")
33 dofile(modpath.."/music_player.lua")
34 dofile(modpath.."/generator.lua")
35 dofile(modpath.."/grinder.lua")
36
37 --MV machines
38 dofile(modpath.."/wires_mv.lua")
39 dofile(modpath.."/battery_box_mv.lua")
612349 40 dofile(modpath.."/solar_panel_mv.lua")
061e6b 41 dofile(modpath.."/electric_furnace_mv.lua")
5d799e 42 dofile(modpath.."/alloy_furnace_mv.lua")
c6da0a 43 dofile(modpath.."/forcefield.lua")
82cba9 44
R 45 --Tools
46 if enable_mining_drill==true then dofile(modpath.."/mining_drill.lua") end
47 if enable_mining_laser==true then dofile(modpath.."/mining_laser_mk1.lua") end
48 if enable_flashlight==true then dofile(modpath.."/flashlight.lua") end
49 dofile(modpath.."/cans.lua")
50 dofile(modpath.."/chainsaw.lua")
51 dofile(modpath.."/tree_tap.lua")
52 dofile(modpath.."/sonic_screwdriver.lua")
53
54 -- mesecons and tubes related
74cf47 55 dofile(modpath.."/injector.lua")
82cba9 56 dofile(modpath.."/node_breaker.lua")
061e6b 57 dofile(modpath.."/deployer.lua")
82cba9 58 dofile(modpath.."/constructor.lua")
478407 59 dofile(modpath.."/frames.lua")
82cba9 60
R 61 if enable_item_drop    then dofile(modpath.."/item_drop.lua") end
62 if enable_item_pickup   then dofile(modpath.."/item_pickup.lua") end
63
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