Skip to content

Commit

Permalink
luacheck
Browse files Browse the repository at this point in the history
  • Loading branch information
NatureFreshMilk committed Aug 23, 2019
1 parent 0fd5e4e commit d442ca6
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 10 deletions.
20 changes: 20 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
allow_defined_top = true

globals = {
"vacuum"
}

read_globals = {
-- Stdlib
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},

-- Minetest
"minetest",
"vector", "ItemStack",
"dump", "VoxelArea",

-- Deps
"default"

}
3 changes: 2 additions & 1 deletion mapgen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local t1 = minetest.get_us_time()
local micros = t1 -t0

minetest.log("action", "[planetoidgen] mapgen for " .. minetest.pos_to_string(minp) .. ", type: " .. planet.type .. " took " .. micros .. " us")
minetest.log("action", "[planetoidgen] mapgen for " .. minetest.pos_to_string(minp) ..
", type: " .. planet.type .. " took " .. micros .. " us")

end)
6 changes: 4 additions & 2 deletions planets.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

--[[
local save_data = function()
local data = minetest.write_json(planetoidgen.planets, true);
Expand All @@ -12,6 +13,7 @@ local save_data = function()
print(S("[Planetoidgen] Error: Savefile '%s' could not be written."):format(tostring(path)));
end
end
--]]


local load_data = function()
Expand All @@ -38,7 +40,7 @@ local load_data = function()
return false
end
else
print(S("[Planetoidgen] Error: Savefile '%s' not found."):format(tostring(path)));
print(("[Planetoidgen] Error: Savefile '%s' not found."):format(tostring(path)));
end

return true
Expand All @@ -50,7 +52,7 @@ load_data()
minetest.register_chatcommand("planetoidgen_reload", {
description = "reload planets.json",
privs = { server = true },
func = function(name, param)
func = function()
if load_data() then
return true, "reload successful"
else
Expand Down
2 changes: 1 addition & 1 deletion planets/classh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local c_shell = minetest.get_content_id("default:desert_sandstone")
local c_sand = minetest.get_content_id("default:desert_sand")


planetoidgen.planettypes["class-h"] = function(planet, minp, maxp, seed)
planetoidgen.planettypes["class-h"] = function(planet, minp, maxp)

local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data()
Expand Down
2 changes: 1 addition & 1 deletion planets/classm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local perlin_map = {}



planetoidgen.planettypes["class-m"] = function(planet, minp, maxp, seed)
planetoidgen.planettypes["class-m"] = function(planet, minp, maxp)

-- setup perlin stuff
local side_length = maxp.x - minp.x + 1 -- 80
Expand Down
2 changes: 1 addition & 1 deletion planets/classn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local c_shell = minetest.get_content_id("default:stone")
local c_top = minetest.get_content_id("default:stone")


planetoidgen.planettypes["class-n"] = function(planet, minp, maxp, seed)
planetoidgen.planettypes["class-n"] = function(planet, minp, maxp)

local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data()
Expand Down
2 changes: 1 addition & 1 deletion planets/classp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local c_shell = minetest.get_content_id("default:ice")
local c_top = minetest.get_content_id("default:snowblock")


planetoidgen.planettypes["class-p"] = function(planet, minp, maxp, seed)
planetoidgen.planettypes["class-p"] = function(planet, minp, maxp)

local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data()
Expand Down
4 changes: 1 addition & 3 deletions planets/sun.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

local c_ignore = minetest.get_content_id("ignore")
local c_air = minetest.get_content_id("air")
local c_sun = minetest.get_content_id("planetoidgen:sun")


planetoidgen.planettypes["sun"] = function(planet, minp, maxp, seed)
planetoidgen.planettypes["sun"] = function(planet, minp, maxp)

local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data()
Expand Down

0 comments on commit d442ca6

Please sign in to comment.