Fix Nether roof light

This commit is contained in:
kay27 2022-01-12 04:02:56 +04:00
parent c6754fd39e
commit 9d171a6b7b
2 changed files with 13 additions and 1 deletions

View File

@ -25,7 +25,7 @@ See https://git.minetest.land/MineClone2/MineClone2/issues/1395
`vm_context.data2 = vm_context.data2 or vm_context.vm.get_param2_data(vm_context.lvm_param2_buffer)`
`write_param2`: set it to true in your lvm callback function, if you used `data2` and want to write it;
`light`: LVM buffer data array of light, !NO ANY DATA LOADS INTO IT BEFORE THE CALLBACKS! - you load it yourself:
`vm_context.light = vm_context.light or vm_context.vm.get_light2_data(vm_context.lvm_light_buffer)`
`vm_context.light = vm_context.light or vm_context.vm.get_light_data(vm_context.lvm_light_buffer)`
`write_light`: set it to true in your lvm callback function, if you used `light` and want to write it;
`lvm_param2_buffer`: static `param2` buffer pointer, used to load `data2` array;
`shadow`: set it to false to disable shadow propagation;

View File

@ -1832,3 +1832,15 @@ dofile(modpath .. "/clay.lua")
if minetest.get_modpath("mcl_structures") then
dofile(modpath .. "/structures.lua")
end
mcl_mapgen.register_mapgen_block_lvm(function(vm_context)
local minp = vm_context.minp
local miny = minp.y
if miny > mcl_mapgen.nether.max+127 then return end
local maxp = vm_context.maxp
local maxy = maxp.y
if maxy <= mcl_mapgen.nether.max then return end
local p1 = {x = minp.x, y = math.max(miny, mcl_mapgen.nether.max + 1), z = minp.z}
local p2 = {x = maxp.x, y = math.min(maxy, mcl_mapgen.nether.max + 127), z = maxp.z}
vm_context.vm:set_lighting({day=15, night=15}, p1, p2)
end, 999999999)