From a8b2b841f88223317dda2b51a71dcd0b556145ad Mon Sep 17 00:00:00 2001 From: NullBite Date: Wed, 28 Jun 2023 01:43:19 -0400 Subject: [PATCH] use world.getTime() instead of getTimeOfDay() getTimeOfDay() breaks if doDaylightCycle is false (i.e. testing world) --- script.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script.lua b/script.lua index 49ad8db..019c873 100644 --- a/script.lua +++ b/script.lua @@ -687,16 +687,16 @@ function tick() setColor() end -- optimization, only execute these with certain frequency -- - if world.getTimeOfDay() % 5 == 0 then -- 1/4 second + if world.getTime() % 5 == 0 then -- 1/4 second if player:getPose() == "SLEEPING" then snore() end -- unneeded for now but can uncomment if needed - --if world.getTimeOfDay() % 20 == 0 then -- 1 second + --if world.getTime() % 20 == 0 then -- 1 second -- Sync state every 10 seconds - if world.getTimeOfDay() % (20*10) == 0 then + if world.getTime() % (20*10) == 0 then sharedstate.sync() end --end