diff options
author | Rogier <rogier777@gmail.com> | 2015-02-07 20:42:23 +0100 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2015-03-11 18:10:16 -0400 |
commit | ab6f2b2556f42e965494e6db82eeb969a7ffe924 (patch) | |
tree | c9ef91f04ba36e1fc8559c82a7591836f3339aab /wrench | |
parent | b8c902868115a0a607da35e208a422e430d46317 (diff) |
Make wrench usable independently of technic
Diffstat (limited to 'wrench')
-rw-r--r-- | wrench/depends.txt | 6 | ||||
-rw-r--r-- | wrench/support.lua | 4 | ||||
-rw-r--r-- | wrench/technic.lua | 28 |
3 files changed, 21 insertions, 17 deletions
diff --git a/wrench/depends.txt b/wrench/depends.txt index 4d126c6..a681af3 100644 --- a/wrench/depends.txt +++ b/wrench/depends.txt @@ -1,6 +1,6 @@ default -technic -technic_chests -technic_worldgen +technic? +technic_chests? +technic_worldgen? intllib? diff --git a/wrench/support.lua b/wrench/support.lua index 6d1c9ab..1d21811 100644 --- a/wrench/support.lua +++ b/wrench/support.lua @@ -66,6 +66,8 @@ function wrench:original_name(name) end function wrench:register_node(name, def) - self.registered_nodes[name] = def + if minetest.registered_nodes[name] then + self.registered_nodes[name] = def + end end diff --git a/wrench/technic.lua b/wrench/technic.lua index c07e3d7..c404180 100644 --- a/wrench/technic.lua +++ b/wrench/technic.lua @@ -323,19 +323,21 @@ for i = 1, 15 do }) end -for tier, _ in pairs(technic.machines) do - local ltier = tier:lower() - for i = 0, 8 do - wrench:register_node("technic:"..ltier.."_battery_box"..i, { - lists = {"src", "dst"}, - metas = {infotext = STRING, - formspec = STRING, - [tier.."_EU_demand"] = INT, - [tier.."_EU_supply"] = INT, - [tier.."_EU_input"] = INT, - internal_EU_charge = INT, - last_side_shown = INT}, - }) +if minetest.get_modpath("technic") then + for tier, _ in pairs(technic.machines) do + local ltier = tier:lower() + for i = 0, 8 do + wrench:register_node("technic:"..ltier.."_battery_box"..i, { + lists = {"src", "dst"}, + metas = {infotext = STRING, + formspec = STRING, + [tier.."_EU_demand"] = INT, + [tier.."_EU_supply"] = INT, + [tier.."_EU_input"] = INT, + internal_EU_charge = INT, + last_side_shown = INT}, + }) + end end end |