From 7ed2adec3fb65d872940b1d1f1a9ca7c54c7d4c7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 22 Aug 2017 00:22:53 +0200 Subject: [PATCH] Fix End lighting. Kinda --- mods/MAPGEN/mcl_biomes/init.lua | 8 +++-- mods/MAPGEN/mcl_mapgen_core/init.lua | 45 +++++++++++++++------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 165f67c7d9..9279ce6f2d 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -565,8 +565,10 @@ local function register_dimension_biomes() node_filler = "air", node_water = "air", node_river_water = "air", + -- FIXME: For some reason the End stops generating early if this constant is not added. + -- Figure out why. y_min = mcl_vars.mg_end_min, - y_max = mcl_vars.mg_end_max, + y_max = mcl_vars.mg_end_max + 80, heat_point = 50, humidity_point = 50, }) @@ -958,7 +960,7 @@ local function register_dimension_ores() ore = "mcl_end:end_stone", wherein = {"air"}, y_min = mcl_vars.mg_end_min+64, - y_max = mcl_vars.mg_end_min+94, + y_max = mcl_vars.mg_end_min+80, column_height_min = 6, column_height_max = 7, column_midpoint_factor = 0.0, @@ -978,7 +980,7 @@ local function register_dimension_ores() ore = "mcl_end:end_stone", wherein = {"air"}, y_min = mcl_vars.mg_end_min+64, - y_max = mcl_vars.mg_end_min+94, + y_max = mcl_vars.mg_end_min+80, column_height_min = 4, column_height_max = 4, column_midpoint_factor = 0.0, diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index aec5414897..59282ea02a 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -1320,15 +1320,21 @@ minetest.register_on_generated(function(minp, maxp) elseif mcl_util.is_in_void({x=x,y=y,z=z}) then data[p_pos] = c_void lvm_used = true + -- Realm barrier between the Overworld void and the End + elseif y >= mcl_vars.mg_realm_barrier_overworld_end_min and y <= mcl_vars.mg_realm_barrier_overworld_end_max then + data[p_pos] = c_realm_barrier + lvm_used = true + -- Flat Nether + elseif mg_name == "flat" and y >= mcl_vars.mg_bedrock_nether_bottom_max + 4 and y <= mcl_vars.mg_bedrock_nether_bottom_max + 52 then + data[p_pos] = c_air + lvm_used = true -- Big lava seas by replacing air below a certain height - elseif mcl_vars.mg_lava and data[p_pos] == c_air then - if y <= mcl_vars.mg_lava_overworld_max and y >= mcl_vars.mg_overworld_min then - data[p_pos] = c_lava - lvm_used = true - elseif y <= mcl_vars.mg_lava_nether_max and y >= mcl_vars.mg_nether_min then - data[p_pos] = c_nether_lava - lvm_used = true - end + elseif mcl_vars.mg_lava and data[p_pos] == c_air and y <= mcl_vars.mg_lava_overworld_max and y >= mcl_vars.mg_overworld_min then + data[p_pos] = c_lava + lvm_used = true + elseif mcl_vars.mg_lava and data[p_pos] == c_air and y <= mcl_vars.mg_lava_nether_max and y >= mcl_vars.mg_nether_min then + data[p_pos] = c_nether_lava + lvm_used = true -- Water in the Nether or End? No way! elseif data[p_pos] == c_water then if y <= mcl_vars.mg_nether_max and y >= mcl_vars.mg_nether_min then @@ -1341,14 +1347,6 @@ minetest.register_on_generated(function(minp, maxp) data[p_pos] = c_air lvm_used = true end - -- Realm barrier between the Overworld void and the End - elseif y >= mcl_vars.mg_realm_barrier_overworld_end_min and y <= mcl_vars.mg_realm_barrier_overworld_end_max then - data[p_pos] = c_realm_barrier - lvm_used = true - -- Flat Nether - elseif mg_name == "flat" and y >= mcl_vars.mg_bedrock_nether_bottom_max + 4 and y <= mcl_vars.mg_bedrock_nether_bottom_max + 52 then - data[p_pos] = c_air - lvm_used = true -- Nether and End support for v6 because v6 does not support the biomes API elseif mg_name == "v6" then if y <= mcl_vars.mg_nether_max and y >= mcl_vars.mg_nether_min then @@ -1387,15 +1385,20 @@ minetest.register_on_generated(function(minp, maxp) end end - -- Set high light level in the End. This is very hacky and messes up the shadows below the End islands. - -- FIXME: Find a better way to do light. - if minp.y >= mcl_vars.mg_end_min and maxp.y <= mcl_vars.mg_end_max then - vm:set_lighting({day=14, night=14}) + local shadow + -- Set sun light level in the End + -- -26912 is at a mapchunk border + if minp.y >= -26912 and maxp.y <= mcl_vars.mg_end_max then + vm:set_lighting({day=15, night=15}) + lvm_used = true + end + if minp.y >= mcl_vars.mg_end_min and maxp.y <= -26911 then + shadow = false lvm_used = true end if lvm_used then vm:set_data(data) - vm:calc_lighting() + vm:calc_lighting(nil, nil, shadow) vm:update_liquids() vm:write_to_map() end