From fbd56e67c915aa92f03cb4795be3e278f1f50372 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Thu, 26 Sep 2024 19:48:32 +0200 Subject: [PATCH] various cleanups --- .luacheckrc | 1 - chest.lua | 2 +- common.lua | 6 ++---- digicode.lua | 4 ++-- doors.lua | 8 ++++---- models.lua | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index d8f740b..5d14883 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,7 +1,6 @@ std = "min+minetest" unused_args = false -max_line_length = 180 globals = { "scifi_nodes" diff --git a/chest.lua b/chest.lua index 4ca91cd..2935a35 100644 --- a/chest.lua +++ b/chest.lua @@ -14,7 +14,7 @@ local chest_formspec = -- Helper functions local function drop_chest_stuff() - return function(pos, oldnode, oldmetadata, digger) + return function(pos, _, oldmetadata) local meta = minetest.get_meta(pos) meta:from_table(oldmetadata) local inv = meta:get_inventory() diff --git a/common.lua b/common.lua index 8bb7a3d..7eaa95a 100644 --- a/common.lua +++ b/common.lua @@ -1,7 +1,5 @@ - -scifi_nodes.get_switch_rules = function(param2) - +function scifi_nodes.get_switch_rules(param2) -- param2 = 2 local rules = { {x=1, y=-1, z=-1}, @@ -10,7 +8,7 @@ scifi_nodes.get_switch_rules = function(param2) {x=0, y=-1, z=1}, } --- Left and right when looking to +y ? + -- Left and right when looking to +y ? if param2 == 3 then rules = mesecon.rotate_rules_right(mesecon.rotate_rules_right (rules)) elseif param2 == 4 then diff --git a/digicode.lua b/digicode.lua index 1a5fdcf..6e8d622 100644 --- a/digicode.lua +++ b/digicode.lua @@ -11,7 +11,7 @@ local digicode_context = {} -- after_place_node, use by digicode and palm_scanner -- placer is a player object -local function set_owner(pos, placer, itemstack, pointed_thing) +local function set_owner(pos, placer) local meta = minetest.get_meta(pos) meta:set_string("owner", placer:get_player_name()) meta:set_string("code", secret_code) @@ -48,7 +48,7 @@ local function update_code(pos, code) meta:set_string("code", code) end -local function show_digicode_formspec(pos, node, player, itemstack, pointed_thing) +local function show_digicode_formspec(pos, _, player) local meta = minetest.get_meta(pos) local owner = meta:get_string("owner") local current_code = meta:get_string("code") diff --git a/doors.lua b/doors.lua index 35ba558..8f317d6 100644 --- a/doors.lua +++ b/doors.lua @@ -120,7 +120,7 @@ for _, current_door in ipairs(doors) do return itemstack; end - local function afterdestruct(pos, oldnode) + local function afterdestruct(pos) minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) end @@ -173,12 +173,12 @@ for _, current_door in ipairs(doors) do timer:start(3) end - local function afterplace(pos, placer, itemstack, pointed_thing) + local function afterplace(pos) local node = minetest.get_node(pos) minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name=opened_top,param2=node.param2}) end - local function ontimer(pos, elapsed) + local function ontimer(pos) -- play sound minetest.sound_play(sound,{ max_hear_distance = 16, @@ -218,7 +218,7 @@ for _, current_door in ipairs(doors) do }, } - local function nodig(pos, digger) + local function nodig() return false end diff --git a/models.lua b/models.lua index dc54c82..98a4049 100644 --- a/models.lua +++ b/models.lua @@ -48,7 +48,7 @@ end -- register some blocks in stairsplus if available (part of moreblocks) scifi_nodes.register_slope("white2", "Plastic", {"scifi_nodes_white2.png",}, 0, "stone") scifi_nodes.register_slope("super_white", "Super Plastic", {"scifi_nodes_super_white.png",}, 11, "stone") -scifi_nodes.register_slope("ultra_white", "Super Plastic", {"scifi_nodes_ultra_white.png",}, minetest.LIGHT_MAX, "stone") +scifi_nodes.register_slope("ultra_white", "Super Plastic", {"scifi_nodes_ultra_white.png",},minetest.LIGHT_MAX, "stone") scifi_nodes.register_slope("black", "Black", {"scifi_nodes_black.png",}, 0) scifi_nodes.register_slope("white", "White", {"scifi_nodes_white.png",}, 0) scifi_nodes.register_slope("grey", "Grey", {"scifi_nodes_grey.png",}, 0)