tweak sky to use skybox mod and weather
This commit is contained in:
parent
101a1f1303
commit
dddadf3736
@ -14,4 +14,4 @@ dofile(path.."/mtvig.lua")
|
||||
dofile(path.."/musicmod.lua")
|
||||
dofile(path.."/nosneak.lua")
|
||||
dofile(path.."/spawn.lua")
|
||||
--dofile(path.."/sky.lua")
|
||||
dofile(path.."/sky.lua")
|
@ -3,7 +3,47 @@ aftermath = {}
|
||||
|
||||
local path = minetest.get_modpath("aftermath")
|
||||
|
||||
--Version 0.2
|
||||
--by emperor_genshin
|
||||
--modified for ESM game by: maikerumine
|
||||
--https://forum.minetest.net/viewtopic.php?f=9&t=13775&hilit=[mod]skybox
|
||||
|
||||
minetest.register_on_joinplayer(player)
|
||||
skybox.set(player, 1)
|
||||
end
|
||||
|
||||
--The skybox for space, feel free to change it to however you like.
|
||||
local spaceskybox = {
|
||||
"sky_pos_y.png",
|
||||
"sky_neg_y.png",
|
||||
"sky_pos_z.png",
|
||||
"sky_neg_z.png",
|
||||
"sky_neg_x.png",
|
||||
"sky_pos_x.png",
|
||||
}
|
||||
|
||||
local time = 0
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
time = time + dtime
|
||||
if time > 5 then for _, player in ipairs(minetest.get_connected_players()) do
|
||||
time = 0
|
||||
|
||||
local name = player:get_player_name()
|
||||
local sky = player:get_attribute("skybox:skybox")--ADDED SKYBOX
|
||||
|
||||
if minetest.get_player_by_name(name) then
|
||||
--player:set_sky({}, "skybox", spaceskybox) -- Sets skybox
|
||||
skybox.set(player, 4)--ADDED SKYBOX
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
|
||||
if name then
|
||||
player:set_sky({}, "regular", {})
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
|
@ -178,7 +178,8 @@ skycolor = {
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
--maikerumine turned this off to use skybox instead
|
||||
--[[
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
if skycolor.active ~= true or #minetest.get_connected_players() == 0 then
|
||||
@ -210,4 +211,5 @@ minetest.register_on_joinplayer(function(player)
|
||||
if (skycolor.active) then
|
||||
skycolor.update_sky_color({player})
|
||||
end
|
||||
end)
|
||||
end)
|
||||
]]
|
Loading…
x
Reference in New Issue
Block a user