From 196a6da26c7eaff3a6eab3dabe0ac27f6777681d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Wed, 1 Mar 2017 07:31:48 -0300 Subject: [PATCH] Remove unused args. --- inventory.lua | 18 +++++++++--------- lcd.lua | 6 +++--- lightsensor.lua | 4 ++-- rtc.lua | 4 ++-- util.lua | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/inventory.lua b/inventory.lua index a7a1a93..70cb133 100644 --- a/inventory.lua +++ b/inventory.lua @@ -58,10 +58,10 @@ minetest.register_node("digilines:chest", { end, after_place_node = tubescan, after_dig_node = tubescan, - can_dig = function(pos, player) + can_dig = function(pos) return minetest.get_meta(pos):get_inventory():is_empty("main") end, - on_receive_fields = function(pos, formname, fields, sender) + on_receive_fields = function(pos, _, fields, sender) local name = sender:get_player_name() if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then minetest.record_protection_violation(pos, name) @@ -74,7 +74,7 @@ minetest.register_node("digilines:chest", { digiline = { receptor = {}, effector = { - action = function(pos,node,channel,msg) end + action = function() end } }, tube = { @@ -83,10 +83,10 @@ minetest.register_node("digilines:chest", { return not pipeworks.connects.facingFront(i,param2) end, input_inventory = "main", - can_insert = function(pos, node, stack, direction) + can_insert = function(pos, _, stack) return can_insert(pos, stack) end, - insert_object = function(pos, node, stack, direction) + insert_object = function(pos, _, stack) local inv = minetest.get_meta(pos):get_inventory() local leftover = inv:add_item("main", stack) local count = leftover:get_count() @@ -108,16 +108,16 @@ minetest.register_node("digilines:chest", { return leftover end, }, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) + allow_metadata_inventory_put = function(pos, _, _, stack) if not can_insert(pos, stack) then sendMessage(pos,"uoverflow "..maybeString(stack)) end return stack:get_count() end, - on_metadata_inventory_move = function(pos, fromlistname, fromindex, tolistname, toindex, count, player) + on_metadata_inventory_move = function(pos, _, _, _, _, _, player) minetest.log("action", player:get_player_name().." moves stuff in chest at "..minetest.pos_to_string(pos)) end, - on_metadata_inventory_put = function(pos, listname, index, stack, player) + on_metadata_inventory_put = function(pos, _, _, stack, player) local channel = minetest.get_meta(pos):get_string("channel") local send = function(msg) sendMessage(pos,msg,channel) @@ -132,7 +132,7 @@ minetest.register_node("digilines:chest", { end minetest.log("action", player:get_player_name().." puts stuff into chest at "..minetest.pos_to_string(pos)) end, - on_metadata_inventory_take = function(pos, listname, index, stack, player) + on_metadata_inventory_take = function(pos, listname, _, stack, player) local meta = minetest.get_meta(pos) local channel = meta:get_string("channel") local inv = meta:get_inventory() diff --git a/lcd.lua b/lcd.lua index 13fcfd7..10e1d48 100644 --- a/lcd.lua +++ b/lcd.lua @@ -140,7 +140,7 @@ local prepare_writing = function(pos) return text end -local on_digiline_receive = function(pos, node, channel, msg) +local on_digiline_receive = function(pos, _, channel, msg) local meta = minetest.get_meta(pos) local setchan = meta:get_string("channel") if setchan ~= channel then return end @@ -173,7 +173,7 @@ minetest.register_node("digilines:lcd", { selection_box = lcd_box, groups = {choppy = 3, dig_immediate = 2}, - after_place_node = function (pos, placer, itemstack) + after_place_node = function (pos) local param2 = minetest.get_node(pos).param2 if param2 == 0 or param2 == 1 then minetest.add_node(pos, {name = "digilines:lcd", param2 = 3}) @@ -189,7 +189,7 @@ minetest.register_node("digilines:lcd", { clearscreen(pos) end, - on_receive_fields = function(pos, formname, fields, sender) + on_receive_fields = function(pos, _, fields, sender) local name = sender:get_player_name() if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then minetest.record_protection_violation(pos, name) diff --git a/lightsensor.lua b/lightsensor.lua index eaabcf6..1c7237b 100644 --- a/lightsensor.lua +++ b/lightsensor.lua @@ -21,7 +21,7 @@ local lsensor_selbox = fixed = {{ -8/16, -8/16, -8/16, 8/16, -3/16, 8/16 }} } -local on_digiline_receive = function (pos, node, channel, msg) +local on_digiline_receive = function (pos, _, channel, msg) local setchan = minetest.get_meta(pos):get_string("channel") if channel == setchan and msg == GET_COMMAND then local lightval = minetest.get_node_light(pos) @@ -50,7 +50,7 @@ minetest.register_node("digilines:lightsensor", { local meta = minetest.get_meta(pos) meta:set_string("formspec", "field[channel;Channel;${channel}]") end, - on_receive_fields = function(pos, formname, fields, sender) + on_receive_fields = function(pos, _, fields, sender) local name = sender:get_player_name() if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then minetest.record_protection_violation(pos, name) diff --git a/rtc.lua b/rtc.lua index 26759d0..a82f774 100644 --- a/rtc.lua +++ b/rtc.lua @@ -16,7 +16,7 @@ local rtc_selbox = fixed = {{ -8/16, -8/16, -8/16, 8/16, -3/16, 8/16 }} } -local on_digiline_receive = function (pos, node, channel, msg) +local on_digiline_receive = function (pos, _, channel, msg) local setchan = minetest.get_meta(pos):get_string("channel") if channel == setchan and msg == GET_COMMAND then local timeofday = minetest.get_timeofday() @@ -46,7 +46,7 @@ minetest.register_node("digilines:rtc", { local meta = minetest.get_meta(pos) meta:set_string("formspec", "field[channel;Channel;${channel}]") end, - on_receive_fields = function(pos, formname, fields, sender) + on_receive_fields = function(pos, _, fields, sender) local name = sender:get_player_name() if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then minetest.record_protection_violation(pos, name) diff --git a/util.lua b/util.lua index e662e4c..ac15fab 100644 --- a/util.lua +++ b/util.lua @@ -22,9 +22,9 @@ 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