From 9fecc03f5ef9ebf2cefe0d457cb9efcb6c30de01 Mon Sep 17 00:00:00 2001 From: MT-Modder Date: Fri, 2 Oct 2015 13:34:39 -0400 Subject: [PATCH] Allow other mods to change worktable nodes Globalize and rename "nodes" table to "worktable_nodes". --- worktable.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worktable.lua b/worktable.lua index 62eb1d3..ec5a88f 100644 --- a/worktable.lua +++ b/worktable.lua @@ -1,7 +1,7 @@ local worktable = {} local xbg = default.gui_bg..default.gui_bg_img..default.gui_slots -local nodes = { -- Nodes allowed to be cut. Mod name = {node name}. +xdecor.worktable_nodes = { -- Nodes allowed to be cut. Mod name = {node name}. default = {"wood", "junglewood", "pine_wood", "acacia_wood", "tree", "jungletree", "pine_tree", "acacia_tree", "cobble", "mossycobble", "desert_cobble", @@ -97,7 +97,7 @@ function worktable.put(_, listname, _, stack, _) if listname == "forms" then return 0 end if listname == "input" then - if not worktable.contains(nodes[mod], node) then return 0 end + if not worktable.contains(xdecor.worktable_nodes[mod], node) then return 0 end end if listname == "hammer" then if stn ~= "xdecor:hammer" then return 0 end @@ -173,7 +173,7 @@ xdecor.register("worktable", { }) for _, d in pairs(def) do -for mod, n in pairs(nodes) do +for mod, n in pairs(xdecor.worktable_nodes) do for _, name in pairs(n) do local ndef = minetest.registered_nodes[mod..":"..name] if ndef then