Hide unused function params
This commit is contained in:
parent
61fe9ecc17
commit
f70d2316d5
@ -24,7 +24,7 @@ function enchanting.is_allowed_tool(toolname)
|
|||||||
else return 0 end
|
else return 0 end
|
||||||
end
|
end
|
||||||
|
|
||||||
function enchanting.fields(pos, formname, fields, sender)
|
function enchanting.fields(pos, _, fields, _)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local toolstack = inv:get_stack("tool", 1)
|
local toolstack = inv:get_stack("tool", 1)
|
||||||
@ -46,7 +46,7 @@ function enchanting.fields(pos, formname, fields, sender)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function enchanting.dig(pos, player)
|
function enchanting.dig(pos, _)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ function enchanting.dig(pos, player)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function enchanting.put(pos, listname, index, stack, player)
|
function enchanting.put(_, listname, _, stack, _)
|
||||||
local toolname = stack:get_name()
|
local toolname = stack:get_name()
|
||||||
local count = stack:get_count()
|
local count = stack:get_count()
|
||||||
|
|
||||||
@ -70,8 +70,7 @@ function enchanting.put(pos, listname, index, stack, player)
|
|||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
function enchanting.move(pos, from_list, from_index, to_list, to_index, count, player)
|
function enchanting.move(_, _, _, _, _, _, _) return 0 end
|
||||||
return 0 end
|
|
||||||
|
|
||||||
xdecor.register("enchantment_table", {
|
xdecor.register("enchantment_table", {
|
||||||
description = "Enchantment Table",
|
description = "Enchantment Table",
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
xdecor = xdecor or {}
|
xdecor = xdecor or {}
|
||||||
|
|
||||||
local default_can_dig = function(pos,player)
|
local default_can_dig = function(pos, _)
|
||||||
local meta = minetest.get_meta(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
|
end
|
||||||
|
|
||||||
xdecor.wood = default.node_sound_wood_defaults()
|
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_size = 32
|
||||||
local default_inventory_formspecs = {
|
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[context;main;0,0;8,1;]"..
|
||||||
"list[current_player;main;0,2;8,4;]",
|
"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[context;main;0,0;8,2;]"..
|
||||||
"list[current_player;main;0,3;8,4;]",
|
"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[context;main;0,0;8,3;]"..
|
||||||
"list[current_player;main;0,4;8,4;]",
|
"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[context;main;0,0.3;8,4;]"..
|
||||||
"list[current_player;main;0,4.85;8,1;]"..
|
"list[current_player;main;0,4.85;8,1;]"..
|
||||||
"list[current_player;main;0,6.08;8,3;8]"..
|
"list[current_player;main;0,6.08;8,3;8]"..
|
||||||
@ -76,5 +78,5 @@ function xdecor.register(name, def)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("xdecor:" .. name, def)
|
minetest.register_node("xdecor:".. name, def)
|
||||||
end
|
end
|
||||||
|
10
hive.lua
10
hive.lua
@ -14,7 +14,7 @@ function hive.construct(pos)
|
|||||||
inv:set_size("honey", 1)
|
inv:set_size("honey", 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function hive.dig(pos, player)
|
function hive.dig(pos, _)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
|
||||||
@ -32,11 +32,11 @@ xdecor.register("hive", {
|
|||||||
groups = {snappy=3, flammable=1},
|
groups = {snappy=3, flammable=1},
|
||||||
on_construct = hive.construct,
|
on_construct = hive.construct,
|
||||||
can_dig = hive.dig,
|
can_dig = hive.dig,
|
||||||
on_punch = function(pos, node, puncher, pointed_thing)
|
on_punch = function(_, _, puncher, _)
|
||||||
local health = puncher:get_hp()
|
local health = puncher:get_hp()
|
||||||
puncher:set_hp(health-4)
|
puncher:set_hp(health - 4)
|
||||||
end,
|
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
|
if listname == "honey" then return 0 end
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
@ -45,7 +45,7 @@ xdecor.register("hive", {
|
|||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"xdecor:hive"},
|
nodenames = {"xdecor:hive"},
|
||||||
interval = 10, chance = 4,
|
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 meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ xdecor.register("frame", {
|
|||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"xdecor:frame"},
|
nodenames = {"xdecor:frame"},
|
||||||
interval = 15, chance = 1,
|
interval = 15, chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, _, _)
|
||||||
local num
|
local num
|
||||||
if node.name ~= "xdecor:frame" then return end
|
if node.name ~= "xdecor:frame" then return end
|
||||||
num = #minetest.get_objects_inside_radius(pos, 0.5)
|
num = #minetest.get_objects_inside_radius(pos, 0.5)
|
||||||
|
@ -6,7 +6,7 @@ xdecor.register("mailbox", {
|
|||||||
"xdecor_mailbox.png", "xdecor_mailbox.png",
|
"xdecor_mailbox.png", "xdecor_mailbox.png",
|
||||||
},
|
},
|
||||||
groups = {cracky=2},
|
groups = {cracky=2},
|
||||||
after_place_node = function(pos, placer, itemstack)
|
after_place_node = function(pos, placer, _)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local owner = placer:get_player_name()
|
local owner = placer:get_player_name()
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ xdecor.register("mailbox", {
|
|||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
inv:set_size("drop", 1)
|
inv:set_size("drop", 1)
|
||||||
end,
|
end,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack)
|
on_rightclick = function(pos, _, clicker, _)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local player = clicker:get_player_name()
|
local player = clicker:get_player_name()
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
@ -37,7 +37,7 @@ xdecor.register("mailbox", {
|
|||||||
if not inv:is_empty("main") then return false end
|
if not inv:is_empty("main") then return false end
|
||||||
return player:get_player_name() == owner
|
return player:get_player_name() == owner
|
||||||
end,
|
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 meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ xdecor.register("mailbox", {
|
|||||||
inv:add_item("main", stack)
|
inv:add_item("main", stack)
|
||||||
end
|
end
|
||||||
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 == "main" then return 0 end
|
||||||
if listname == "drop" then
|
if listname == "drop" then
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
2
rope.lua
2
rope.lua
@ -7,7 +7,7 @@ minetest.register_on_punchnode(function(pos, oldnode, digger)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function rope.place(itemstack, placer, pointed_thing)
|
function rope.place(itemstack, _, pointed_thing)
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
local under = pointed_thing.under
|
local under = pointed_thing.under
|
||||||
local above = pointed_thing.above
|
local above = pointed_thing.above
|
||||||
|
@ -52,7 +52,7 @@ function worktable.construct(pos)
|
|||||||
inv:set_size("hammer", 1)
|
inv:set_size("hammer", 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function worktable.fields(pos, formname, fields, sender)
|
function worktable.fields(pos, _, fields, _)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local inputstack = inv:get_stack("input", 1)
|
local inputstack = inv:get_stack("input", 1)
|
||||||
@ -81,7 +81,7 @@ function worktable.fields(pos, formname, fields, sender)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function worktable.dig(pos, player)
|
function worktable.dig(pos, _)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ function worktable.dig(pos, player)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function worktable.put(pos, listname, index, stack, player)
|
function worktable.put(_, listname, _, stack, _)
|
||||||
local stackname = stack:get_name()
|
local stackname = stack:get_name()
|
||||||
local count = stack:get_count()
|
local count = stack:get_count()
|
||||||
local mat = minetest.serialize(material)
|
local mat = minetest.serialize(material)
|
||||||
@ -115,8 +115,7 @@ function worktable.put(pos, listname, index, stack, player)
|
|||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
function worktable.move(pos, from_list, from_index, to_list, to_index, count, player)
|
function worktable.move(_, _, _, _, _, _, _) return 0 end
|
||||||
return 0 end
|
|
||||||
|
|
||||||
xdecor.register("worktable", {
|
xdecor.register("worktable", {
|
||||||
description = "Work Table",
|
description = "Work Table",
|
||||||
@ -174,7 +173,7 @@ end
|
|||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"xdecor:worktable"},
|
nodenames = {"xdecor:worktable"},
|
||||||
interval = 3, chance = 1,
|
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 meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local tool = inv:get_stack("tool", 1)
|
local tool = inv:get_stack("tool", 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user