Skip to content

Commit

Permalink
Make some Stairs+ functions local and add Luacheck ignores
Browse files Browse the repository at this point in the history
Those functions are used in various places in the mod,
so they aren't unused.
  • Loading branch information
Calinou committed Mar 9, 2019
1 parent 7dd3e1f commit e622c69
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion stairsplus/custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ local subset = {
}
--]]

function register_custom_subset(subset, modname, subname, recipeitem, groups, images, description, drop, light)
-- luacheck: no unused
local function register_custom_subset(subset, modname, subname, recipeitem, groups, images, description, drop, light)
stairsplus:register_custom_subset(subset, modname, subname, recipeitem, {
groups = groups,
tiles = images,
Expand Down
3 changes: 2 additions & 1 deletion stairsplus/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function stairsplus:register_alias_force_all(modname_old, subname_old, modname_n
self:register_micro_alias_force(modname_old, subname_old, modname_new, subname_new)
end

function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light)
-- luacheck: no unused
local function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light)
stairsplus:register_all(modname, subname, recipeitem, {
groups = groups,
tiles = images,
Expand Down
3 changes: 2 additions & 1 deletion stairsplus/microblocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Licensed under the zlib license. See LICENSE.md for more information.

-- Node will be called <modname>:micro_<subname>

function register_micro(modname, subname, recipeitem, groups, images, description, drop, light)
-- luacheck: no unused
local function register_micro(modname, subname, recipeitem, groups, images, description, drop, light)
stairsplus:register_micro(modname, subname, recipeitem, {
groups = groups,
tiles = images,
Expand Down
3 changes: 2 additions & 1 deletion stairsplus/panels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Licensed under the zlib license. See LICENSE.md for more information.

-- Node will be called <modname>:panel_<subname>

function register_panel(modname, subname, recipeitem, groups, images, description, drop, light)
-- luacheck: no unused
local function register_panel(modname, subname, recipeitem, groups, images, description, drop, light)
stairsplus:register_panel(modname, subname, recipeitem, {
groups = groups,
tiles = images,
Expand Down
6 changes: 2 additions & 4 deletions stairsplus/slabs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ Copyright © 2011-2019 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]

local S = moreblocks.S

-- Node will be called <modname>:slab_<subname>

function register_slab(modname, subname, recipeitem, groups, images, description, drop, light)
-- luacheck: no unused
local function register_slab(modname, subname, recipeitem, groups, images, description, drop, light)
stairsplus:register_slab(modname, subname, recipeitem, {
groups = groups,
tiles = images,
Expand All @@ -36,7 +35,6 @@ end

function stairsplus:register_slab(modname, subname, recipeitem, fields)
local defs = table.copy(stairsplus.defs["slab"])
local desc_base = S("%s Slab"):format(fields.description)
for alternate, shape in pairs(defs) do
stairsplus.register_single("slab", alternate, shape, modname, subname, recipeitem, fields)
end
Expand Down
3 changes: 2 additions & 1 deletion stairsplus/slopes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Licensed under the zlib license. See LICENSE.md for more information.

-- Node will be called <modname>:slope_<subname>

function register_slope(modname, subname, recipeitem, groups, images, description, drop, light)
-- luacheck: no unused
local function register_slope(modname, subname, recipeitem, groups, images, description, drop, light)
stairsplus:register_slope(modname, subname, recipeitem, {
groups = groups,
tiles = images,
Expand Down
3 changes: 2 additions & 1 deletion stairsplus/stairs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Licensed under the zlib license. See LICENSE.md for more information.

-- Node will be called <modname>:stair_<subname>

function register_stair(modname, subname, recipeitem, groups, images, description, drop, light)
-- luacheck: no unused
local function register_stair(modname, subname, recipeitem, groups, images, description, drop, light)
stairsplus:register_stair(modname, subname, recipeitem, {
groups = groups,
tiles = images,
Expand Down

1 comment on commit e622c69

@dargow
Copy link

@dargow dargow commented on e622c69 Jan 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some old mods uses function register_stair_slab_panel_micro.
Example: infrastructure https://forum.minetest.net/viewtopic.php?id=4822
I just put this function global for fix

Please sign in to comment.