Skip to content

Commit

Permalink
tidied up code
Browse files Browse the repository at this point in the history
  • Loading branch information
theFox6 committed Dec 29, 2023
1 parent 291876f commit 93d2f25
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
5 changes: 3 additions & 2 deletions .luacheck_tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ read_globals = {
"dump", "vector",
"VoxelManip", "VoxelArea",
"ItemStack", "PseudoRandom",
"stairsplus", "intllib",
"unified_inventory",
"intllib", "farming",
"stairs", "stairsplus",
"ingots", "unified_inventory",
math = { fields = {"sign"} },
table = { fields = {"copy"} }
}
Expand Down
2 changes: 2 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ max_line_length = false
read_globals = {
"default",
"dump",
"farming",
"ingots",
"intllib",
"ItemStack",
math = { fields = {"sign"} },
Expand Down
2 changes: 1 addition & 1 deletion items/storage_tank.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function factory.register_storage_tank(name, increment, tiles, plaintile, light,
wield_image = "factory_storage_tank.png",
groups = {not_in_creative_inventory = 1},
stack_max = 1,
on_place = function(itemstack, placer, pointed_thing)
on_place = function(itemstack, _, pointed_thing)
if not pointed_thing or pointed_thing.type ~= "node" then
return
end
Expand Down
36 changes: 18 additions & 18 deletions machines/crafting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ minetest.register_craft({
minetest.register_craft( {
output = "factory:autocrafter",
recipe = {
{ "factory:factory_brick", "factory:factory_brick", "factory:factory_brick" },
{ "factory:small_diamond_gear", "default:steel_ingot", "factory:small_diamond_gear" },
{ "factory:factory_brick", "factory:factory_brick", "factory:factory_brick" }
{ "factory:factory_brick", "factory:factory_brick", "factory:factory_brick" },
{ "factory:small_diamond_gear", "default:steel_ingot", "factory:small_diamond_gear" },
{ "factory:factory_brick", "factory:factory_brick", "factory:factory_brick" }
},
})

Expand All @@ -67,7 +67,7 @@ minetest.register_craft({
minetest.register_craft({
type = "shapeless",
output = "factory:taker_diamond",
recipe = {"factory:taker_gold", "factory:small_diamond_gear"} --"default:diamondblock"
recipe = {"factory:taker_gold", "factory:small_diamond_gear"} --"default:diamondblock"
})

minetest.register_craft({
Expand Down Expand Up @@ -101,12 +101,12 @@ minetest.register_craft({
})

minetest.register_craft({
output = "factory:grinder",
recipe = {
{"default:stonebrick", "default:stonebrick", "default:stonebrick"},
{"factory:small_diamond_gear", "", "factory:small_diamond_gear"},
{"default:stonebrick", "default:furnace", "default:stonebrick"}
}
output = "factory:grinder",
recipe = {
{"default:stonebrick", "default:stonebrick", "default:stonebrick"},
{"factory:small_diamond_gear", "", "factory:small_diamond_gear"},
{"default:stonebrick", "default:furnace", "default:stonebrick"}
}
})

minetest.register_craft({
Expand Down Expand Up @@ -170,13 +170,13 @@ minetest.register_craft({
})

if factory.setting_enabled("StpCraft") then
minetest.register_craft({
output = "factory:stp",
recipe = {
{ "factory:factory_brick", "factory:small_diamond_gear", "factory:factory_brick" },
{ "default:glass", "default:dirt", "factory:factory_brick" },
{ "factory:factory_brick", "default:mese_crystal", "factory:factory_brick" }
}
})
minetest.register_craft({
output = "factory:stp",
recipe = {
{ "factory:factory_brick", "factory:small_diamond_gear", "factory:factory_brick" },
{ "default:glass", "default:dirt", "factory:factory_brick" },
{ "factory:factory_brick", "default:mese_crystal", "factory:factory_brick" }
}
})
end
-- vim: et:ai:sw=2:ts=2:fdm=indent:syntax=lua
3 changes: 2 additions & 1 deletion machines/vacuum.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ minetest.register_abm({
neighbors = nil,
interval = 1,
chance = 1,
action = function(pos, node, _, aocw)
-- pos, node, active_object_count, active_object_count_wider
action = function(pos, _, _, aocw)
if aocw == 0 then return end
local all_objects = factory.get_objects_with_square_radius({x = pos.x, y = pos.y + 3, z = pos.z}, 2)
for _,obj in ipairs(all_objects) do
Expand Down

0 comments on commit 93d2f25

Please sign in to comment.