0
0
Fork 0

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

View File

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

View File

@ -1,4 +1,4 @@
name = mcl_end_island
author = Fleckenstein
depends = mcl_mapgen_core, mcl_end
depends = mcl_mapgen_core, mcl_end, mcl_mobs
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
vm:set_lighting({day=15, night=15})
return true, false
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
local realpos = vector.offset(pos,0,1,0)
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
mcl_structures.place_structure(realpos,struct,pr,blockseed)
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_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.deco_id = minetest.get_decoration_id("mcl_structures:deco_"..name)
minetest.set_gen_notify({decoration=true}, { def.deco_id })

View File

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

View File

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