mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
optional time_of_day arg for mcl_beds.is_night()
This commit is contained in:
parent
dadb39dd92
commit
38ea214bfe
1 changed files with 5 additions and 2 deletions
|
@ -58,9 +58,12 @@ local monster_exceptions = {
|
|||
["mobs_mc:shulker"] = true,
|
||||
}
|
||||
|
||||
function mcl_beds.is_night()
|
||||
function mcl_beds.is_night(tod)
|
||||
-- Values taken from Minecraft Wiki with offset of +600
|
||||
local tod = ( minetest.get_timeofday() * 24000 ) % 24000
|
||||
if not tod then
|
||||
tod = minetest.get_timeofday()
|
||||
end
|
||||
tod = ( tod * 24000 ) % 24000
|
||||
return tod > 18541 or tod < 5458
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue