Implemented HybridDog's change requests.

- Should be ready to merge now.
This commit is contained in:
Deathwing777 2024-02-29 06:38:21 -08:00 committed by GitHub
parent 6c30874736
commit e7c5de04eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 15 deletions

View File

@ -53,7 +53,7 @@ nether.start = f_h_max+100
local NETHER_HEIGHT = 30
-- bottom height of the nether.
nether.bottom = nether_middle - NETHER_HEIGHT
nether.bottom = nether_middle - NETHER_HEIGHT - 100
-- Maximum amount of randomness in the map generation
local NETHER_RANDOM = 2

View File

@ -52,6 +52,19 @@ function nether.is_player_trapped_in_nether(player)
return players_trapped_in_nether[player:get_player_name()]
end
local update_background
if nether.trap_players then
function update_background(player, down)
if down then
player:set_sky({r=15, g=0, b=0}, "plain")
else
player:set_sky(nil, "regular")
end
end
else
function update_background()end
end
-- Nether aware mods may have other means of moving players between the Nether
-- and Overworld, and if so, they should tell us about it so we can keep track
-- of the player state.
@ -74,7 +87,7 @@ function nether.registry_update(player)
local in_nether = (pos.y < nether.start) and (pos.y >= nether.bottom)
local pname = player:get_player_name()
if nether.trap_players then
players_trapped_in_nether[pname] = in_nether
players_trapped_in_nether[pname] = in_nether or nil
update_background(player, in_nether)
elseif players_trapped_in_nether[pname] then
players_trapped_in_nether[pname] = nil
@ -82,19 +95,6 @@ function nether.registry_update(player)
end
end
local update_background
if nether.trap_players then
function update_background(player, down)
if down then
player:set_sky({r=15, g=0, b=0}, "plain")
else
player:set_sky(nil, "regular")
end
end
else
function update_background()end
end
-- returns nodename if area is generated, else calls generation function
local function generated_or_generate(pos)
local node = minetest.get_node_or_nil(pos)