RealBadAngel
2012-12-13 b8d77627a4d28c624e63423eef317dd09c68e533
commit | author | age
b8d776 1 -- Minetest 0.4.4 : technic
167434 2
MK 3 minetest.register_alias("rebar", "technic:rebar")
4 minetest.register_alias("concrete", "technic:concrete")
5 minetest.register_alias("concrete_post", "technic:concrete_post")
6 minetest.register_alias("iron_chest", "technic:iron_chest")
7 minetest.register_alias("iron_locked_chest", "technic:iron_locked_chest")
8 minetest.register_alias("copper_chest", "technic:copper_chest")
9 minetest.register_alias("copper_locked_chest", "technic:copper_locked_chest")
10 minetest.register_alias("silver_chest", "technic:silver_chest")
11 minetest.register_alias("silver_locked_chest", "technic:silver_locked_chest")
12 minetest.register_alias("gold_chest", "technic:gold_chest")
13 minetest.register_alias("gold_locked_chest", "technic:gold_locked_chest")
14 minetest.register_alias("mithril_chest", "technic:mithril_chest")
15 minetest.register_alias("mithril_locked_chest", "technic:mithril_locked_chest")
16
808049 17
MK 18 modpath=minetest.get_modpath("technic")
19
335061 20 --Read technic config file
808049 21 dofile(modpath.."/config.lua")
335061 22
b8d776 23 -- world gen
R 24 dofile(modpath.."/ores.lua")
25 if enable_rubber_tree_generation==true then dofile(modpath.."/rubber.lua") end
26
27 -- chests
808049 28 dofile(modpath.."/iron_chest.lua")
MK 29 dofile(modpath.."/copper_chest.lua")
30 dofile(modpath.."/silver_chest.lua")
31 dofile(modpath.."/gold_chest.lua")
32 dofile(modpath.."/mithril_chest.lua")
b8d776 33
R 34 --items 
35 dofile(modpath.."/concrete.lua")
36 dofile(modpath.."/items.lua")
37
38 --LV machines
39 dofile(modpath.."/alloy_furnace.lua")
808049 40 dofile(modpath.."/solar_panel.lua")
MK 41 dofile(modpath.."/geothermal.lua")
42 dofile(modpath.."/water_mill.lua")
b8d776 43 dofile(modpath.."/electric_furnace.lua")
R 44 dofile(modpath.."/battery_box.lua")
45 dofile(modpath.."/wires.lua")
46 dofile(modpath.."/tool_workshop.lua")
47 dofile(modpath.."/music_player.lua")
48 dofile(modpath.."/generator.lua")
49 dofile(modpath.."/grinder.lua")
167434 50
808049 51 --MV machines
b8d776 52 dofile(modpath.."/wires_mv.lua")
808049 53 dofile(modpath.."/solar_panel_mv.lua")
MK 54 dofile(modpath.."/battery_box_mv.lua")
167434 55
b8d776 56 --Tools
R 57 if enable_mining_dril==true then dofile(modpath.."/mining_drill.lua") end
58 if enable_mining_laser==true then dofile(modpath.."/mining_laser_mk1.lua") end
59 if enable_flashlight==true then dofile(modpath.."/flashlight.lua") end
60 dofile(modpath.."/cans.lua")
61 dofile(modpath.."/chainsaw.lua")
62 dofile(modpath.."/tree_tap.lua")
63 dofile(modpath.."/screwdriver.lua")
64 dofile(modpath.."/sonic_screwdriver.lua")
65
66 -- mesecons and tubes related
67 dofile(modpath.."/injector.lua")
68 dofile(modpath.."/node_breaker.lua")
69 dofile(modpath.."/deployer.lua")
70 dofile(modpath.."/constructor.lua")
71
72 if enable_item_drop    then dofile(modpath.."/item_drop.lua") end
73 if enable_item_pickup   then dofile(modpath.."/item_pickup.lua") end
167434 74
MK 75 function has_locked_chest_privilege(meta, player)
76     if player:get_player_name() ~= meta:get_string("owner") then
77         return false
78     end
79     return true
80 end
81
82
83 function hacky_swap_node(pos,name)
84     local node = minetest.env:get_node(pos)
85     local meta = minetest.env:get_meta(pos)
86     local meta0 = meta:to_table()
87     if node.name == name then
88         return nil
89     end
90     node.name = name
91     local meta0 = meta:to_table()
92     minetest.env:set_node(pos,node)
93     meta = minetest.env:get_meta(pos)
94     meta:from_table(meta0)
95     return 1
b8d776 96 end