From 907e8bf6a64215a516fdf16869dd81248aeaa2f6 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 17 Mar 2017 16:53:18 -0400 Subject: update digilines, technic, unified inventory, and switched castles to the new modpack form --- digilines/util.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'digilines/util.lua') diff --git a/digilines/util.lua b/digilines/util.lua index cec75be..ac15fab 100644 --- a/digilines/util.lua +++ b/digilines/util.lua @@ -1,13 +1,13 @@ -function digiline:addPosRule(p, r) +function digilines.addPosRule(p, r) return {x = p.x + r.x, y = p.y + r.y, z = p.z + r.z} end -function digiline:cmpPos(p1, p2) +function digilines.cmpPos(p1, p2) return (p1.x == p2.x and p1.y == p2.y and p1.z == p2.z) end --Rules rotation Functions: -function digiline:rotate_rules_right(rules) +function digilines.rotate_rules_right(rules) local nr={} for i, rule in ipairs(rules) do nr[i]={} @@ -18,18 +18,18 @@ function digiline:rotate_rules_right(rules) return nr end -function digiline:rotate_rules_left(rules) +function digilines.rotate_rules_left(rules) local nr={} for i, rule in ipairs(rules) do nr[i]={} - nr[i].z=-rules[i].x - nr[i].x=rules[i].z - nr[i].y=rules[i].y + nr[i].z=-rule.x + nr[i].x=rule.z + nr[i].y=rule.y end return nr end -function digiline:rotate_rules_down(rules) +function digilines.rotate_rules_down(rules) local nr={} for i, rule in ipairs(rules) do nr[i]={} @@ -40,7 +40,7 @@ function digiline:rotate_rules_down(rules) return nr end -function digiline:rotate_rules_up(rules) +function digilines.rotate_rules_up(rules) local nr={} for i, rule in ipairs(rules) do nr[i]={} @@ -51,13 +51,13 @@ function digiline:rotate_rules_up(rules) return nr end -function digiline:tablecopy(table) -- deep table copy +function digilines.tablecopy(table) -- deep table copy if type(table) ~= "table" then return table end -- no need to copy local newtable = {} for idx, item in pairs(table) do if type(item) == "table" then - newtable[idx] = digiline:tablecopy(item) + newtable[idx] = digilines.tablecopy(item) else newtable[idx] = item end @@ -88,12 +88,12 @@ local vm_cache = nil -- directly on VM-loaded arrays, which should be faster for reading many nodes -- in rapid succession. However, the cache must be flushed with vm_end once the -- scan is finished, to avoid using stale data in future. -function digiline:vm_begin() +function digilines.vm_begin() vm_cache = {} end -- Ends a bulk-VoxelManipulator operation, freeing the cached data. -function digiline:vm_end() +function digilines.vm_end() vm_cache = nil end @@ -141,7 +141,7 @@ end -- there. -- -- Inside a bulk-VoxelManipulator operation, the operation’s VM cache is used. -function digiline:get_node_force(pos) +function digilines.get_node_force(pos) if vm_cache then return vm_get_node(pos) end -- cgit v1.2.3