Voxelis/mods/MAPGEN/vox_mapgen_core/init.lua
DesertMermaid 0242488c9e
All checks were successful
Error Check / luacheck_errcheck (push) Successful in 47s
Unit Tests / busted_unit_test (push) Successful in 51s
Some more tweaks. Lets merge BLOCKS back into ITEMS because some blocks are also items, and... its just better this way.
2024-12-11 08:10:38 -08:00

68 lines
2.3 KiB
Lua

---------------------------------------------------------------------------
-- Voxelis - Voxel survival sandbox for Luanti
-- Copyright (C) 2024 Mad Star Studio LLC
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- You should have received a copy of the GNU General Public License along
-- with this program; if not, see <http://www.gnu.org/licenses/>.
---------------------------------------------------------------------------
vox_mapgen_core = { }
-- Also run...
dofile(minetest.get_modpath("vox_mapgen_core").."/ores.lua")
-- Disable minetest dungeons. We're making our own with blackjack and hookers.
minetest.set_mapgen_setting("mg_flags", "dungeons", false)
-- Some adjustments based on different generators.
-- For now we allow v7, and haven't looked at the other generators.
if mg_name == "v7" then
minetest.set_mapgen_setting("mg7_cavern_threshold", 0.2, true)
minetest.set_mapgen_setting("mg_flags", "dungeons", false)
end
-- And some superflat tweaks.
if superflat then
-- Disable caves
minetest.set_mapgen_setting("mg_flags", "caves", false)
-- Disable dungeons
minetest.set_mapgen_setting("mg_flags", "dungeons", false)
-- Disable decorations
minetest.set_mapgen_setting("mg_flags", "decoration", false)
minetest.set_mapgen_setting("mgflat_spflags", "nocaves,nohills", true)
end
-- Generate flat bedrock at the lowest point of the world, -10000.
local function generate_bedrock(minp, maxp, data)
local vi = 0
for z = minp.z, maxp.z do
for x = minp.x, maxp.x do
for y = -10000, -10000 do
local c_air = minetest.get_content_id("air")
data[vi] = c_air
vi = vi + 1
end
end
end
end
-- Put air/void beneath bedrock
local function generate_void(minp, maxp, data)
local vi = 0
for z = minp.z, maxp.z do
for x = minp.x, maxp.x do
for y = -10001, -31000 do
local c_air = minetest.get_content_id("air")
data[vi] = c_air
vi = vi + 1
end
end
end
end