You don't need additional nodes, you can set the light manually using
vmanip.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.override_item("default:wood", {
on_construct = function(pos)
local pos1 = vector.add(pos, -5)
local pos2 = vector.add(pos, 5)
-- Get the vmanip object and the area and nodes
local manip = minetest.get_voxel_manip()
local e1, e2 = manip:read_from_map(pos1, pos2)
local area = VoxelArea:new{MinEdge=e1, MaxEdge=e2}
local data = manip:get_light_data()
-- set non-sunlight everywhere to 15
for i in area:iterp(pos1, pos2) do
-- 4 Bit independent light, 4 Bit sunlight
data[i] = 0xf0 + data[i] % 0x10
end
-- Return the changed, change map and show it to the players
manip:set_light_data(data)
manip:write_to_map()
end
})
l need to rework my shadows mod…