make the end island slightly larger

also uses the mcl_mapgen_core api now
This commit is contained in:
cora 2022-09-11 02:51:47 +02:00 committed by Gitea
parent abb6fe3564
commit 2c7838bdf6
3 changed files with 16 additions and 22 deletions

View File

@ -163,7 +163,7 @@ mcl_vars.mg_end_min = -27073 -- Carefully chosen to be at a mapchunk border
mcl_vars.mg_end_max_official = mcl_vars.mg_end_min + minecraft_height_limit mcl_vars.mg_end_max_official = mcl_vars.mg_end_min + minecraft_height_limit
mcl_vars.mg_end_max = mcl_vars.mg_overworld_min - 2000 mcl_vars.mg_end_max = mcl_vars.mg_overworld_min - 2000
mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_vars.mg_end_min + 74, z = 0 } mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_vars.mg_end_min + 74, z = 0 }
mcl_vars.mg_end_exit_portal_pos = vector.new(0, mcl_vars.mg_end_min + 72, 0) mcl_vars.mg_end_exit_portal_pos = vector.new(0, mcl_vars.mg_end_min + 71, 0)
-- Realm barrier used to safely separate the End from the void below the Overworld -- Realm barrier used to safely separate the End from the void below the Overworld
mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max

View File

@ -1,34 +1,31 @@
local width = 115
local noisemap = PerlinNoiseMap({ local noisemap = PerlinNoiseMap({
offset = 0.5, offset = 0.5,
scale = 0.5, scale = 0.5,
spread = {x = 84, y = 84, z = 84}, spread = {x = width + 10, y = width + 10, z = width + 10},
seed = minetest.get_mapgen_setting("seed") + 99999, seed = minetest.get_mapgen_setting("seed") + 99999,
octaves = 4, octaves = 4,
persist = 0.85, persist = 0.85,
}, {x = 151, y = 30, z = 151}):get_3d_map({x = 0, y = 0, z = 0}) }, {x = (width*2)+1, y = 30, z = (width * 2) + 1}):get_3d_map({x = 0, y = 0, z = 0})
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 y_offset = -2 local y_offset = -2
minetest.register_on_generated(function(minp, maxp) mcl_mapgen_core.register_generator("end_island", function(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
if maxp.y < (-27025 + y_offset) or minp.y > (-27000 + y_offset + 4) or maxp.x < -75 or minp.x > 75 or maxp.z < -75 or minp.z > 75 then if maxp.y < (-27025 + y_offset) or minp.y > (-27000 + y_offset + 4) or maxp.x < -width or minp.x > width or maxp.z < -width or minp.z > width then
return return
end end
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") for idx in area:iter(math.max(minp.x, -width), math.max(minp.y, -27025 + y_offset + 4), math.max(minp.z, -width), math.min(maxp.x, width), math.min(maxp.y, -27000 + y_offset), math.min(maxp.z, width)) do
local data = vm:get_data()
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
for idx in area:iter(math.max(minp.x, -75), math.max(minp.y, -27025 + y_offset + 4), math.max(minp.z, -75), math.min(maxp.x, 75), math.min(maxp.y, -27000 + y_offset), math.min(maxp.z, 75)) do
local pos = area:position(idx) local pos = area:position(idx)
local y = 27025 + pos.y - y_offset local y = 27025 + pos.y - y_offset
if noisemap[pos.x + 75 + 1][y + 1][pos.z + 75 + 1] > (math.abs(1 - y / 25) ^ 2 + math.abs(pos.x / 75) ^ 2 + math.abs(pos.z / 75) ^ 2) then if noisemap[pos.x + width + 1][y + 1][pos.z + width + 1] > (math.abs(1 - y / 25) ^ 2 + math.abs(pos.x / width) ^ 2 + math.abs(pos.z / width) ^ 2) then
data[idx] = c_end_stone data[idx] = c_end_stone
end end
end end
--vm:calc_lighting()
vm:set_data(data) --vm:update_liquids()
vm:calc_lighting() --vm:write_to_map()
vm:update_liquids() return true,true
vm:write_to_map() end, nil, 15, true)
end)

View File

@ -20,11 +20,7 @@ mcl_structures.register_structure("end_exit_portal",{
after_place = function(pos,def,pr) after_place = function(pos,def,pr)
local p1 = vector.offset(pos,-5,-5,-5) local p1 = vector.offset(pos,-5,-5,-5)
local p2 = vector.offset(pos,5,5,5) local p2 = vector.offset(pos,5,5,5)
minetest.emerge_area(p1, p2, function(blockpos, action, calls_remaining, param) minetest.bulk_set_node(minetest.find_nodes_in_area(p1,p2,{"mcl_portals:portal_end"}),{name="air"})
if calls_remaining ~= 0 then return end
local nn = minetest.find_nodes_in_area(p1,p2,{"mcl_portals:portal_end"})
minetest.bulk_set_node(nn,{name="air"})
end)
end end
}) })
mcl_structures.register_structure("end_exit_portal_open",{ mcl_structures.register_structure("end_exit_portal_open",{
@ -74,5 +70,6 @@ mcl_structures.register_structure("end_spike",{
minetest.set_node(vector.offset(s,0,1,0),{name="mcl_core:bedrock"}) minetest.set_node(vector.offset(s,0,1,0),{name="mcl_core:bedrock"})
minetest.add_entity(vector.offset(s,0,2,0),"mcl_end:crystal") minetest.add_entity(vector.offset(s,0,2,0),"mcl_end:crystal")
end) end)
return true
end, end,
}) })