diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index f9f7435aa..70324cb8f 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -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