From 4cebaa99f88e25e039416354cf490fe98642af7e Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 1 Nov 2012 21:38:20 +0000 Subject: Refactored the world time. Now it is stored in two values - WorldAge (only incremented, plugins cannot change) and TimeOfDay (plugins can change). Since sub-tick precision is needed in Tick(), we store it both as number of seconds (double) and number of ticks (Int64) is calculated off of that. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1022 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Core/time.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/Core/time.lua b/MCServer/Plugins/Core/time.lua index 425d69e6a..8515972a6 100644 --- a/MCServer/Plugins/Core/time.lua +++ b/MCServer/Plugins/Core/time.lua @@ -6,10 +6,10 @@ function HandleTimeCommand( Split, Player ) local Server = cRoot:Get():GetServer() if( string.upper( Split[2] ) == "DAY") then - Player:GetWorld():SetWorldTime( 0 ) + Player:GetWorld():SetTimeOfDay( 0 ) Server:SendMessage( cChatColor.Green .. Player:GetName() .. " set the time to Day.") elseif( string.upper( Split[2] ) == "NIGHT") then - Player:GetWorld():SetWorldTime( 12000 + 1000 ) + Player:GetWorld():SetTimeOfDay( 12000 + 1000 ) Server:SendMessage( cChatColor.Green .. Player:GetName() .. " set the time to Night.") else Player:SendMessage( cChatColor.Green .. "Usage: /time [Day/Night]" ) -- cgit v1.2.3