Fix lighting issues in the end

This commit is contained in:
cora 2022-09-13 02:37:48 +02:00 committed by Gitea
parent 540bf56b91
commit 78703d2baa
7 changed files with 29 additions and 20 deletions

View File

@ -5038,7 +5038,7 @@ local function register_dimension_decorations()
decoration = "mcl_end:chorus_plant", decoration = "mcl_end:chorus_plant",
height = 1, height = 1,
height_max = 8, height_max = 8,
biomes = { "End", "EndIsland", "EndMidlands", "EndHighlands", "EndBarrens", "EndSmallIslands" }, biomes = { "End", "EndMidlands", "EndHighlands", "EndBarrens", "EndSmallIslands" },
}) })
minetest.register_decoration({ minetest.register_decoration({
name = "mcl_biomes:chorus_plant", name = "mcl_biomes:chorus_plant",
@ -5059,7 +5059,7 @@ local function register_dimension_decorations()
y_max = mcl_vars.mg_end_max, y_max = mcl_vars.mg_end_max,
decoration = "mcl_end:chorus_flower", decoration = "mcl_end:chorus_flower",
height = 1, height = 1,
biomes = { "End", "EndIsland", "EndMidlands", "EndHighlands", "EndBarrens", "EndSmallIslands" }, biomes = { "End", "EndMidlands", "EndHighlands", "EndBarrens", "EndSmallIslands" },
}) })
deco_id_chorus_plant = minetest.get_decoration_id("mcl_biomes:chorus_plant") deco_id_chorus_plant = minetest.get_decoration_id("mcl_biomes:chorus_plant")

View File

@ -24,14 +24,17 @@ mcl_mapgen_core.register_generator("end_island", function(vm, data, data2, emin,
data[idx] = c_end_stone data[idx] = c_end_stone
end end
end end
return true,false,true return true,false,false
end, function(minp,maxp,blockseed) end, function(minp,maxp,blockseed)
local nn = minetest.find_nodes_in_area(minp,maxp,{"mcl_end:chorus_flower"}) 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
end
local nn = minetest.find_nodes_in_area_under_air(minp,maxp,{"mcl_end:end_stone"})
local pr = PseudoRandom(blockseed) local pr = PseudoRandom(blockseed)
for _,pos in pairs(nn) do table.shuffle(nn)
local x, y, z = pos.x, pos.y, pos.z if nn and #nn > 0 then
if x < -10 or x > 10 or z < -10 or z > 10 then for i=1,pr:next(1,math.min(5,#nn)) do
mcl_end.grow_chorus_plant(pos,{name="mcl_end:chorus_flower"},pr) minetest.add_entity(vector.offset(nn[i],0,1,0),"mobs_mc:enderman")
end end
end end
end, 15, true) end, 15, true)

View File

@ -1,4 +1,4 @@
name = mcl_end_island name = mcl_end_island
author = Fleckenstein author = Fleckenstein
depends = mcl_mapgen_core, mcl_end depends = mcl_mapgen_core, mcl_end, mcl_mobs
description = Generate the end main island for MCL2 description = Generate the end main island for MCL2

View File

@ -343,7 +343,6 @@ local function end_basic(vm, data, data2, emin, emax, area, minp, maxp, blocksee
end end
end end
end end
vm:set_lighting({day=15, night=15})
return true, false return true, false
end end
@ -373,6 +372,7 @@ mcl_mapgen_core.register_generator("structures",nil, function(minp, maxp, blocks
for _, pos in pairs(gennotify["decoration#"..struct.deco_id] or {}) do for _, pos in pairs(gennotify["decoration#"..struct.deco_id] or {}) do
local realpos = vector.offset(pos,0,1,0) local realpos = vector.offset(pos,0,1,0)
minetest.remove_node(realpos) minetest.remove_node(realpos)
minetest.fix_light(vector.offset(pos,-1,-1,-1),vector.offset(pos,1,3,1))
if struct.chunk_probability == nil or (not has and pr:next(1,struct.chunk_probability) == 1 ) then if struct.chunk_probability == nil or (not has and pr:next(1,struct.chunk_probability) == 1 ) then
mcl_structures.place_structure(realpos,struct,pr,blockseed) mcl_structures.place_structure(realpos,struct,pr,blockseed)
has=true has=true

View File

@ -230,7 +230,7 @@ function mcl_structures.register_structure(name,def,nospawn) --nospawn means it
y_max = def.y_max, y_max = def.y_max,
y_min = def.y_min y_min = def.y_min
}) })
minetest.register_node(":"..structblock, {drawtype="airlike", walkable = false, pointable = false,groups = sbgroups}) minetest.register_node(":"..structblock, {drawtype="airlike", walkable = false, pointable = false,groups = sbgroups,sunlight_propagates = true,})
def.structblock = structblock def.structblock = structblock
def.deco_id = minetest.get_decoration_id("mcl_structures:deco_"..name) def.deco_id = minetest.get_decoration_id("mcl_structures:deco_"..name)
minetest.set_gen_notify({decoration=true}, { def.deco_id }) minetest.set_gen_notify({decoration=true}, { def.deco_id })

View File

@ -18,12 +18,12 @@ end
mcl_structures.register_structure("end_shipwreck",{ mcl_structures.register_structure("end_shipwreck",{
place_on = {"mcl_end:end_stone"}, place_on = {"mcl_end:end_stone"},
fill_ratio = 0.01, fill_ratio = 0.001,
flags = "place_center_x, place_center_z, all_floors", flags = "place_center_x, place_center_z, all_floors",
y_offset = function(pr) return pr:next(-50,-20) end, y_offset = function(pr) return pr:next(-50,-20) end,
chunk_probability = 1900, chunk_probability = 800,
y_max = mcl_vars.mg_end_max, --y_max = mcl_vars.mg_end_max,
y_min = mcl_vars.mg_end_min -100, --y_min = mcl_vars.mg_end_min -100,
biomes = { "End", "EndHighlands", "EndMidlands", "EndBarrens", "EndSmallIslands" }, biomes = { "End", "EndHighlands", "EndMidlands", "EndBarrens", "EndSmallIslands" },
sidelen = 32, sidelen = 32,
filenames = { filenames = {
@ -91,9 +91,9 @@ mcl_structures.register_structure("end_boat",{
fill_ratio = 0.01, fill_ratio = 0.01,
flags = "place_center_x, place_center_z, all_floors", flags = "place_center_x, place_center_z, all_floors",
y_offset = function(pr) return pr:next(15,30) end, y_offset = function(pr) return pr:next(15,30) end,
chunk_probability = 1200, chunk_probability = 900,
y_max = mcl_vars.mg_end_max, --y_max = mcl_vars.mg_end_max,
y_min = mcl_vars.mg_end_min -100, --y_min = mcl_vars.mg_end_min -100,
biomes = { "End", "EndHighlands", "EndMidlands", "EndBarrens", "EndSmallIslands" }, biomes = { "End", "EndHighlands", "EndMidlands", "EndBarrens", "EndSmallIslands" },
sidelen = 20, sidelen = 20,
filenames = { filenames = {

View File

@ -18,8 +18,8 @@ mcl_structures.register_structure("end_exit_portal",{
modpath.."/schematics/mcl_structures_end_exit_portal.mts" modpath.."/schematics/mcl_structures_end_exit_portal.mts"
}, },
after_place = function(pos,def,pr,blockseed) after_place = function(pos,def,pr,blockseed)
local p1 = vector.offset(pos,-5,-5,-5) local p1 = vector.offset(pos,-16,-16,-16)
local p2 = vector.offset(pos,5,5,5) local p2 = vector.offset(pos,16,16,16)
minetest.bulk_set_node(minetest.find_nodes_in_area(p1,p2,{"mcl_portals:portal_end"}),{name="air"}) minetest.bulk_set_node(minetest.find_nodes_in_area(p1,p2,{"mcl_portals:portal_end"}),{name="air"})
local obj = minetest.add_entity(vector.offset(pos,3, 11, 3), "mobs_mc:enderdragon") local obj = minetest.add_entity(vector.offset(pos,3, 11, 3), "mobs_mc:enderdragon")
if obj then if obj then
@ -31,12 +31,18 @@ mcl_structures.register_structure("end_exit_portal",{
else else
minetest.log("error", "[mcl_mapgen_core] ERROR! Ender dragon doesn't want to spawn") minetest.log("error", "[mcl_mapgen_core] ERROR! Ender dragon doesn't want to spawn")
end end
minetest.fix_light(p1,p2)
end end
}) })
mcl_structures.register_structure("end_exit_portal_open",{ mcl_structures.register_structure("end_exit_portal_open",{
filenames = { filenames = {
modpath.."/schematics/mcl_structures_end_exit_portal.mts" modpath.."/schematics/mcl_structures_end_exit_portal.mts"
}, },
after_place = function(pos,def,pr)
local p1 = vector.offset(pos,-16,-16,-16)
local p2 = vector.offset(pos,16,16,16)
minetest.fix_light(p1,p2)
end
}) })
mcl_structures.register_structure("end_gateway_portal",{ mcl_structures.register_structure("end_gateway_portal",{
filenames = { filenames = {