1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 12:10:30 +00:00

Merge pull request #1378 from MCJack123/patch-15

Add more explanation on how `os.epoch("ingame")` works
This commit is contained in:
Jonathan Coates 2023-03-16 06:25:21 +00:00 committed by GitHub
commit 1848d91646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,13 +345,21 @@ public class OSAPI implements ILuaAPI {
/** /**
* Returns the number of milliseconds since an epoch depending on the locale. * Returns the number of milliseconds since an epoch depending on the locale.
* <p> * <p>
* * If called with {@code ingame}, returns the number of milliseconds since the * * If called with {@code ingame}, returns the number of *in-game* milliseconds since the
* world was created. This is the default. * world was created. This is the default.
* * If called with {@code utc}, returns the number of milliseconds since 1 * * If called with {@code utc}, returns the number of milliseconds since 1
* January 1970 in the UTC timezone. * January 1970 in the UTC timezone.
* * If called with {@code local}, returns the number of milliseconds since 1 * * If called with {@code local}, returns the number of milliseconds since 1
* January 1970 in the server's local timezone. * January 1970 in the server's local timezone.
* *
* :::info
* The {@code ingame} time zone assumes that one Minecraft day consists of 86,400,000
* milliseconds. Since one in-game day is much faster than a real day (20 minutes), this
* will change quicker than real time - one real second is equal to 72000 in-game
* milliseconds. If you wish to convert this value to real time, divide by 72000; to
* convert to ticks (where a day is 24000 ticks), divide by 3600.
* :::
*
* @param args The locale to get the milliseconds for. Defaults to {@code ingame} if not set. * @param args The locale to get the milliseconds for. Defaults to {@code ingame} if not set.
* @return The milliseconds since the epoch depending on the selected locale. * @return The milliseconds since the epoch depending on the selected locale.
* @throws LuaException If an invalid locale is passed. * @throws LuaException If an invalid locale is passed.