summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua9
-rw-r--r--nic.lua8
2 files changed, 9 insertions, 8 deletions
diff --git a/init.lua b/init.lua
index 13786a6..1deefe1 100644
--- a/init.lua
+++ b/init.lua
@@ -4,7 +4,6 @@ local components = {
"touchscreen",
"light",
"noteblock",
- "nic",
"camera",
"button",
"panel",
@@ -16,3 +15,11 @@ local components = {
for _,name in ipairs(components) do
dofile(string.format("%s%s%s.lua",minetest.get_modpath(minetest.get_current_modname()),DIR_DELIM,name))
end
+
+local http = minetest.request_http_api()
+if not http then
+ minetest.log("error","digistuff is not allowed to use the HTTP API - digilines NIC will not be available!")
+ minetest.log("error","If this functionality is desired, please add digistuff to your secure.http_mods setting")
+else
+ loadfile(string.format("%s%s%s.lua",minetest.get_modpath(minetest.get_current_modname()),DIR_DELIM,"nic"))(http)
+end
diff --git a/nic.lua b/nic.lua
index eb6ac9d..8760bdf 100644
--- a/nic.lua
+++ b/nic.lua
@@ -1,10 +1,4 @@
-local http = minetest.request_http_api()
-if not http then
- minetest.log("error","digistuff is not allowed to use the HTTP API - digilines NIC will not be available!")
- minetest.log("error","If this functionality is desired, please add digistuff to your secure.http_mods setting")
- return
-end
-
+local http = ...
minetest.register_node("digistuff:nic", {
description = "Digilines NIC",
groups = {cracky=3},