mirror of
https://github.com/HybridDog/nether-pack.git
synced 2025-07-12 04:50:24 +02:00
Fixes Issue #14
Fixes: "Needs a global table so other mods can be nether aware. #14"
This commit is contained in:
@ -13,6 +13,9 @@ end)
|
|||||||
local save_path = minetest.get_worldpath() .. "/nether_players"
|
local save_path = minetest.get_worldpath() .. "/nether_players"
|
||||||
local players_in_nether = {}
|
local players_in_nether = {}
|
||||||
|
|
||||||
|
-- Global table to store things that nether aware mods might need to access.
|
||||||
|
NETHER = {}
|
||||||
|
|
||||||
-- Load the list of players which are trapped in the nether
|
-- Load the list of players which are trapped in the nether
|
||||||
-- (or would be trapped if nether.trap_players was true)
|
-- (or would be trapped if nether.trap_players was true)
|
||||||
do
|
do
|
||||||
@ -29,6 +32,16 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Nether aware mods will need to know if a player is in the nether.
|
||||||
|
NETHER['is_player_in_nether'] = function (player)
|
||||||
|
local pname = player:get_player_name()
|
||||||
|
if players_in_nether[pname] == nil then
|
||||||
|
return false
|
||||||
|
else
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function save_nether_players()
|
local function save_nether_players()
|
||||||
local playernames,n = {},1
|
local playernames,n = {},1
|
||||||
for name in pairs(players_in_nether) do
|
for name in pairs(players_in_nether) do
|
||||||
|
Reference in New Issue
Block a user