From f70d2316d5fff247095b8239f6678179645fe00c Mon Sep 17 00:00:00 2001 From: jp Date: Wed, 12 Aug 2015 20:49:07 +0200 Subject: [PATCH] Hide unused function params --- enchanting.lua | 9 ++++----- handlers/registration.lua | 16 +++++++++------- hive.lua | 10 +++++----- itemframe.lua | 2 +- mailbox.lua | 8 ++++---- rope.lua | 2 +- worktable.lua | 11 +++++------ 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/enchanting.lua b/enchanting.lua index d85dc8e..ea371b7 100644 --- a/enchanting.lua +++ b/enchanting.lua @@ -24,7 +24,7 @@ function enchanting.is_allowed_tool(toolname) else return 0 end end -function enchanting.fields(pos, formname, fields, sender) +function enchanting.fields(pos, _, fields, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local toolstack = inv:get_stack("tool", 1) @@ -46,7 +46,7 @@ function enchanting.fields(pos, formname, fields, sender) end end -function enchanting.dig(pos, player) +function enchanting.dig(pos, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -56,7 +56,7 @@ function enchanting.dig(pos, player) return true end -function enchanting.put(pos, listname, index, stack, player) +function enchanting.put(_, listname, _, stack, _) local toolname = stack:get_name() local count = stack:get_count() @@ -70,8 +70,7 @@ function enchanting.put(pos, listname, index, stack, player) return count end -function enchanting.move(pos, from_list, from_index, to_list, to_index, count, player) - return 0 end +function enchanting.move(_, _, _, _, _, _, _) return 0 end xdecor.register("enchantment_table", { description = "Enchantment Table", diff --git a/handlers/registration.lua b/handlers/registration.lua index cf2e9fd..818f15d 100644 --- a/handlers/registration.lua +++ b/handlers/registration.lua @@ -1,8 +1,10 @@ xdecor = xdecor or {} -local default_can_dig = function(pos,player) +local default_can_dig = function(pos, _) local meta = minetest.get_meta(pos) - return meta:get_inventory():is_empty("main") + local inv = meta:get_inventory() + + return inv:is_empty("main") end xdecor.wood = default.node_sound_wood_defaults() @@ -13,19 +15,19 @@ xdecor.fancy_gui = default.gui_bg..default.gui_bg_img..default.gui_slots local default_inventory_size = 32 local default_inventory_formspecs = { - ["8"]="size[8,6]"..xdecor.fancy_gui.. + ["8"] = "size[8,6]"..xdecor.fancy_gui.. "list[context;main;0,0;8,1;]".. "list[current_player;main;0,2;8,4;]", - ["16"]="size[8,7]"..xdecor.fancy_gui.. + ["16"] = "size[8,7]"..xdecor.fancy_gui.. "list[context;main;0,0;8,2;]".. "list[current_player;main;0,3;8,4;]", - ["24"]="size[8,8]"..xdecor.fancy_gui.. + ["24"] = "size[8,8]"..xdecor.fancy_gui.. "list[context;main;0,0;8,3;]".. "list[current_player;main;0,4;8,4;]", - ["32"]="size[8,9]"..xdecor.fancy_gui.. + ["32"] = "size[8,9]"..xdecor.fancy_gui.. "list[context;main;0,0.3;8,4;]".. "list[current_player;main;0,4.85;8,1;]".. "list[current_player;main;0,6.08;8,3;8]".. @@ -76,5 +78,5 @@ function xdecor.register(name, def) end end - minetest.register_node("xdecor:" .. name, def) + minetest.register_node("xdecor:".. name, def) end diff --git a/hive.lua b/hive.lua index 66bca6a..f030d55 100644 --- a/hive.lua +++ b/hive.lua @@ -14,7 +14,7 @@ function hive.construct(pos) inv:set_size("honey", 1) end -function hive.dig(pos, player) +function hive.dig(pos, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -32,11 +32,11 @@ xdecor.register("hive", { groups = {snappy=3, flammable=1}, on_construct = hive.construct, can_dig = hive.dig, - on_punch = function(pos, node, puncher, pointed_thing) + on_punch = function(_, _, puncher, _) local health = puncher:get_hp() - puncher:set_hp(health-4) + puncher:set_hp(health - 4) end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) + allow_metadata_inventory_put = function(_, listname, _, stack, _) if listname == "honey" then return 0 end return stack:get_count() end, @@ -45,7 +45,7 @@ xdecor.register("hive", { minetest.register_abm({ nodenames = {"xdecor:hive"}, interval = 10, chance = 4, - action = function(pos, node, active_object_count, active_object_count_wider) + action = function(pos, _, _, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() diff --git a/itemframe.lua b/itemframe.lua index dac34db..c7ca180 100644 --- a/itemframe.lua +++ b/itemframe.lua @@ -132,7 +132,7 @@ xdecor.register("frame", { minetest.register_abm({ nodenames = {"xdecor:frame"}, interval = 15, chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) + action = function(pos, node, _, _) local num if node.name ~= "xdecor:frame" then return end num = #minetest.get_objects_inside_radius(pos, 0.5) diff --git a/mailbox.lua b/mailbox.lua index a390301..9dd3040 100644 --- a/mailbox.lua +++ b/mailbox.lua @@ -6,7 +6,7 @@ xdecor.register("mailbox", { "xdecor_mailbox.png", "xdecor_mailbox.png", }, groups = {cracky=2}, - after_place_node = function(pos, placer, itemstack) + after_place_node = function(pos, placer, _) local meta = minetest.get_meta(pos) local owner = placer:get_player_name() @@ -17,7 +17,7 @@ xdecor.register("mailbox", { inv:set_size("main", 8*4) inv:set_size("drop", 1) end, - on_rightclick = function(pos, node, clicker, itemstack) + on_rightclick = function(pos, _, clicker, _) local meta = minetest.get_meta(pos) local player = clicker:get_player_name() local owner = meta:get_string("owner") @@ -37,7 +37,7 @@ xdecor.register("mailbox", { if not inv:is_empty("main") then return false end return player:get_player_name() == owner end, - on_metadata_inventory_put = function(pos, listname, index, stack, player) + on_metadata_inventory_put = function(pos, listname, _, stack, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -46,7 +46,7 @@ xdecor.register("mailbox", { inv:add_item("main", stack) end end, - allow_metadata_inventory_put = function(pos, listname, index, stack, player) + allow_metadata_inventory_put = function(pos, listname, _, stack, _) if listname == "main" then return 0 end if listname == "drop" then local meta = minetest.get_meta(pos) diff --git a/rope.lua b/rope.lua index f0fa5f8..5b2868e 100644 --- a/rope.lua +++ b/rope.lua @@ -7,7 +7,7 @@ minetest.register_on_punchnode(function(pos, oldnode, digger) end end) -function rope.place(itemstack, placer, pointed_thing) +function rope.place(itemstack, _, pointed_thing) if pointed_thing.type == "node" then local under = pointed_thing.under local above = pointed_thing.above diff --git a/worktable.lua b/worktable.lua index 10e4e03..4b30233 100644 --- a/worktable.lua +++ b/worktable.lua @@ -52,7 +52,7 @@ function worktable.construct(pos) inv:set_size("hammer", 1) end -function worktable.fields(pos, formname, fields, sender) +function worktable.fields(pos, _, fields, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local inputstack = inv:get_stack("input", 1) @@ -81,7 +81,7 @@ function worktable.fields(pos, formname, fields, sender) end end -function worktable.dig(pos, player) +function worktable.dig(pos, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -92,7 +92,7 @@ function worktable.dig(pos, player) return true end -function worktable.put(pos, listname, index, stack, player) +function worktable.put(_, listname, _, stack, _) local stackname = stack:get_name() local count = stack:get_count() local mat = minetest.serialize(material) @@ -115,8 +115,7 @@ function worktable.put(pos, listname, index, stack, player) return count end -function worktable.move(pos, from_list, from_index, to_list, to_index, count, player) - return 0 end +function worktable.move(_, _, _, _, _, _, _) return 0 end xdecor.register("worktable", { description = "Work Table", @@ -174,7 +173,7 @@ end minetest.register_abm({ nodenames = {"xdecor:worktable"}, interval = 3, chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) + action = function(pos, _, _, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local tool = inv:get_stack("tool", 1)