summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-10-29 14:08:23 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-10-29 14:08:23 -0400
commit7887d28e0816cb946ee73724545fad5ca1792203 (patch)
tree87d6ac9c1b2a3d39bb9c3bc201b291dbcb10ae82 /init.lua
parent3d19cca557b3f0f176412dada60a98d256687438 (diff)
downloadpipeworks-7887d28e0816cb946ee73724545fad5ca1792203.tar
pipeworks-7887d28e0816cb946ee73724545fad5ca1792203.tar.gz
pipeworks-7887d28e0816cb946ee73724545fad5ca1792203.tar.bz2
pipeworks-7887d28e0816cb946ee73724545fad5ca1792203.tar.xz
pipeworks-7887d28e0816cb946ee73724545fad5ca1792203.zip
make worldpath and modpath pipeworks-namespace-specific and global
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua40
1 files changed, 21 insertions, 19 deletions
diff --git a/init.lua b/init.lua
index 106b471..afbe3a8 100644
--- a/init.lua
+++ b/init.lua
@@ -8,17 +8,19 @@
-- Read (and if necessary, copy) the config file
+pipeworks = {}
+
local DEBUG = false
-local worldpath = minetest.get_worldpath()
-local modpath = minetest.get_modpath("pipeworks")
+pipeworks.worldpath = minetest.get_worldpath()
+pipeworks.modpath = minetest.get_modpath("pipeworks")
-dofile(modpath.."/default_settings.txt")
+dofile(pipeworks.modpath.."/default_settings.txt")
-if io.open(worldpath.."/pipeworks_settings.txt","r") == nil then
+if io.open(pipeworks.worldpath.."/pipeworks_settings.txt","r") == nil then
- io.input(modpath.."/default_settings.txt")
- io.output(worldpath.."/pipeworks_settings.txt")
+ io.input(pipeworks.modpath.."/default_settings.txt")
+ io.output(pipeworks.worldpath.."/pipeworks_settings.txt")
local size = 2^13 -- good buffer size (8K)
while true do
@@ -31,7 +33,7 @@ if io.open(worldpath.."/pipeworks_settings.txt","r") == nil then
end
else
- dofile(worldpath.."/pipeworks_settings.txt")
+ dofile(pipeworks.worldpath.."/pipeworks_settings.txt")
end
-- Helper functions
@@ -106,24 +108,24 @@ end
-- Load the various parts of the mod
-dofile(modpath.."/autoplace.lua")
-dofile(modpath.."/item_transport.lua")
-dofile(modpath.."/flowing_logic.lua")
-dofile(modpath.."/crafts.lua")
+dofile(pipeworks.modpath.."/autoplace.lua")
+dofile(pipeworks.modpath.."/item_transport.lua")
+dofile(pipeworks.modpath.."/flowing_logic.lua")
+dofile(pipeworks.modpath.."/crafts.lua")
-dofile(modpath.."/tubes.lua")
+dofile(pipeworks.modpath.."/tubes.lua")
rules_all = {{x=0, y=0, z=1},{x=0, y=0, z=-1},{x=1, y=0, z=0},{x=-1, y=0, z=0},
{x=0, y=1, z=1},{x=0, y=1, z=-1},{x=1, y=1, z=0},{x=-1, y=1, z=0},
{x=0, y=-1, z=1},{x=0, y=-1, z=-1},{x=1, y=-1, z=0},{x=-1, y=-1, z=0},
{x=0, y=1, z=0}, {x=0, y=-1, z=0}}
-if enable_pipes then dofile(modpath.."/pipes.lua") end
-if enable_teleport_tube then dofile(modpath.."/teleport_tube.lua") end
-if enable_pipe_devices then dofile(modpath.."/devices.lua") end
-if enable_redefines then dofile(modpath.."/compat.lua") end
-if enable_autocrafter then dofile(modpath.."/autocrafter.lua") end
-if enable_deployer then dofile(modpath.."/deployer.lua") end
-if enable_node_breaker then dofile(modpath.."/node_breaker.lua") end
+if enable_pipes then dofile(pipeworks.modpath.."/pipes.lua") end
+if enable_teleport_tube then dofile(pipeworks.modpath.."/teleport_tube.lua") end
+if enable_pipe_devices then dofile(pipeworks.modpath.."/devices.lua") end
+if enable_redefines then dofile(pipeworks.modpath.."/compat.lua") end
+if enable_autocrafter then dofile(pipeworks.modpath.."/autocrafter.lua") end
+if enable_deployer then dofile(pipeworks.modpath.."/deployer.lua") end
+if enable_node_breaker then dofile(pipeworks.modpath.."/node_breaker.lua") end
minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")