summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-09-14 15:20:19 -0500
committercheapie <no-email-for-you@example.com>2024-09-14 15:20:19 -0500
commit21ddad626844c494e17d277b54445a9e675625a5 (patch)
treead8cd2b2df28688cab6b8aa177c81c94021320c8
parent0c619f62c96162d61e646825d0caa7b0e6c5e060 (diff)
downloadicemachine-21ddad626844c494e17d277b54445a9e675625a5.tar
icemachine-21ddad626844c494e17d277b54445a9e675625a5.tar.gz
icemachine-21ddad626844c494e17d277b54445a9e675625a5.tar.bz2
icemachine-21ddad626844c494e17d277b54445a9e675625a5.tar.xz
icemachine-21ddad626844c494e17d277b54445a9e675625a5.zip
Add luacheck configuration and minor cleanupsHEADmaster
-rw-r--r--.luacheckrc8
-rw-r--r--init.lua8
2 files changed, 12 insertions, 4 deletions
diff --git a/.luacheckrc b/.luacheckrc
new file mode 100644
index 0000000..4a1863f
--- /dev/null
+++ b/.luacheckrc
@@ -0,0 +1,8 @@
+max_line_length = 160
+
+read_globals = {
+ "minetest",
+ "vector",
+ "pipeworks",
+ "technic",
+}
diff --git a/init.lua b/init.lua
index ce5c620..d637cfa 100644
--- a/init.lua
+++ b/init.lua
@@ -1,12 +1,12 @@
-local pipeworks_installed = minetest.get_modpath("pipeworks")
+local pipeworks_installed = minetest.global_exists("pipeworks")
local function find_water_supply(pos)
if not pipeworks_installed then return true end
local minp = vector.add(pos,vector.new(-1,-1,-1))
local maxp = vector.add(pos,vector.new(1,1,1))
local nodes = minetest.find_nodes_in_area(minp,maxp,"group:pipe")
- for _,pos in pairs(nodes) do
- local node = minetest.get_node(pos)
+ for _,pipepos in pairs(nodes) do
+ local node = minetest.get_node(pipepos)
if string.match(node.name,"^pipeworks:.*_loaded$") then
return true
end
@@ -174,6 +174,6 @@ minetest.register_craft({
recipe = {"default:ice"},
})
-if minetest.get_modpath("technic") then
+if minetest.global_exists("technic") then
technic.register_grinder_recipe({input={"default:ice 1"},output="default:snowblock 1"})
end