Refactor content IDs in mcl_mapgen_core

This commit is contained in:
Wuzzy 2017-08-21 17:57:11 +02:00
parent 25ce811edc
commit 2e63dd0a3d

View File

@ -1231,16 +1231,6 @@ local generate_nether_decorations = function(minp, maxp)
end end
-- Below the bedrock, generate air/void
minetest.register_on_generated(function(minp, maxp)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data(lvm_buffer)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local lvm_used = false
local liquids_used = false
-- Generate bedrock and lava layers
if minp.y <= GEN_MAX then
local c_bedrock = minetest.get_content_id("mcl_core:bedrock") local c_bedrock = minetest.get_content_id("mcl_core:bedrock")
local c_stone = minetest.get_content_id("mcl_core:stone") local c_stone = minetest.get_content_id("mcl_core:stone")
local c_dirt = minetest.get_content_id("mcl_core:dirt") local c_dirt = minetest.get_content_id("mcl_core:dirt")
@ -1253,8 +1243,19 @@ minetest.register_on_generated(function(minp, maxp)
local c_nether_lava = minetest.get_content_id("mcl_nether:nether_lava_source") local c_nether_lava = minetest.get_content_id("mcl_nether:nether_lava_source")
local c_end_stone = minetest.get_content_id("mcl_end:end_stone") local c_end_stone = minetest.get_content_id("mcl_end:end_stone")
local c_realm_barrier = minetest.get_content_id("mcl_core:realm_barrier") local c_realm_barrier = minetest.get_content_id("mcl_core:realm_barrier")
local c_top_snow = minetest.get_content_id("mcl_core:snow")
local c_air = minetest.get_content_id("air") local c_air = minetest.get_content_id("air")
-- Below the bedrock, generate air/void
minetest.register_on_generated(function(minp, maxp)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data(lvm_buffer)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local lvm_used = false
local liquids_used = false
-- Generate bedrock and lava layers
if minp.y <= GEN_MAX then
local max_y = math.min(maxp.y, GEN_MAX) local max_y = math.min(maxp.y, GEN_MAX)
for y = minp.y, max_y do for y = minp.y, max_y do
@ -1365,7 +1366,6 @@ minetest.register_on_generated(function(minp, maxp)
-- Put top snow on grassy snow blocks created by the v6 mapgen -- Put top snow on grassy snow blocks created by the v6 mapgen
-- This is because the snowy grass block must only be used when it is below snow or top snow -- This is because the snowy grass block must only be used when it is below snow or top snow
if mg_name == "v6" then if mg_name == "v6" then
local c_top_snow = minetest.get_content_id("mcl_core:snow")
local snowdirt = minetest.find_nodes_in_area_under_air(minp, maxp, "mcl_core:dirt_with_grass_snow") local snowdirt = minetest.find_nodes_in_area_under_air(minp, maxp, "mcl_core:dirt_with_grass_snow")
for n = 1, #snowdirt do for n = 1, #snowdirt do
-- CHECKME: What happens at chunk borders? -- CHECKME: What happens at chunk borders?