Make wrench usable independently of technic

This commit is contained in:
Rogier 2015-02-07 20:42:23 +01:00 committed by Vanessa Ezekowitz
parent b8c9028681
commit ab6f2b2556
3 changed files with 21 additions and 17 deletions

@ -1,6 +1,6 @@
default default
technic technic?
technic_chests technic_chests?
technic_worldgen technic_worldgen?
intllib? intllib?

@ -66,6 +66,8 @@ function wrench:original_name(name)
end end
function wrench:register_node(name, def) function wrench:register_node(name, def)
self.registered_nodes[name] = def if minetest.registered_nodes[name] then
self.registered_nodes[name] = def
end
end end

@ -323,19 +323,21 @@ for i = 1, 15 do
}) })
end end
for tier, _ in pairs(technic.machines) do if minetest.get_modpath("technic") then
local ltier = tier:lower() for tier, _ in pairs(technic.machines) do
for i = 0, 8 do local ltier = tier:lower()
wrench:register_node("technic:"..ltier.."_battery_box"..i, { for i = 0, 8 do
lists = {"src", "dst"}, wrench:register_node("technic:"..ltier.."_battery_box"..i, {
metas = {infotext = STRING, lists = {"src", "dst"},
formspec = STRING, metas = {infotext = STRING,
[tier.."_EU_demand"] = INT, formspec = STRING,
[tier.."_EU_supply"] = INT, [tier.."_EU_demand"] = INT,
[tier.."_EU_input"] = INT, [tier.."_EU_supply"] = INT,
internal_EU_charge = INT, [tier.."_EU_input"] = INT,
last_side_shown = INT}, internal_EU_charge = INT,
}) last_side_shown = INT},
})
end
end end
end end