add stdmin.lua

This commit is contained in:
MihailRis
2024-10-09 05:30:02 +03:00
parent b4578cfb87
commit 6e0304248b
8 changed files with 245 additions and 246 deletions
@@ -28,7 +28,7 @@
},
"desert": {
"parameters": [
{"weight": 0.1, "value": 0},
{"weight": 0.3, "value": 0},
{"weight": 0.1, "value": 0}
],
"layers": [
@@ -1,13 +1,3 @@
-- Get entry-point and filename from `entry-point:filename` path
-- // TODO: move to stdmin
function parse_path(path)
local index = string.find(path, ':')
if index == nil then
error("invalid path syntax (':' missing)")
end
return string.sub(path, 1, index-1), string.sub(path, index+1, -1)
end
local _, dir = parse_path(__DIR__)
ores = file.read_combined_list(dir.."/ores.json")
@@ -45,7 +35,7 @@ function place_structures(x, z, w, d, seed, hmap, chunk_height)
local sz = z + math.random() * 20 - 10
local ez = z + math.random() * 20 - 10
table.insert(placements,
{":line", 0, {sx - 10, sy, sz - 10}, {ex + 10, ey, ez + 10}, 3})
{":line", 0, {sx - 10, sy, sz - 10}, {ex + 10, ey, ez + 10}, math.random()*2+2})
end
return placements
end