summaryrefslogtreecommitdiff
path: root/digilines/util.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-17 16:53:18 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-03-17 16:53:18 -0400
commit907e8bf6a64215a516fdf16869dd81248aeaa2f6 (patch)
treed199282e5764c7ab5183fe0d78ed0412dbb0b89f /digilines/util.lua
parent06d9243586cecb1abed74550ce2544b436572a35 (diff)
downloaddreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.tar
dreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.tar.gz
dreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.tar.bz2
dreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.tar.xz
dreambuilder_modpack-907e8bf6a64215a516fdf16869dd81248aeaa2f6.zip
update digilines, technic, unified inventory,
and switched castles to the new modpack form
Diffstat (limited to 'digilines/util.lua')
-rw-r--r--digilines/util.lua28
1 files changed, 14 insertions, 14 deletions
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