mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-05 17:46:21 +00:00
Small cleanup to OS API docs
- Mention the timer event in os.startTimer. Really we should have a similar example here too, but let's at least link the two for now. - Fix strftime link
This commit is contained in:
parent
e154b0db2a
commit
0d3e00cc41
@ -64,7 +64,7 @@ forgeGradle = "6.0.20"
|
||||
githubRelease = "2.5.2"
|
||||
gradleVersions = "0.50.0"
|
||||
ideaExt = "1.1.7"
|
||||
illuaminate = "0.1.0-69-gf294ab2"
|
||||
illuaminate = "0.1.0-71-g378d86e"
|
||||
librarian = "1.+"
|
||||
lwjgl = "3.3.3"
|
||||
minotaur = "2.+"
|
||||
|
@ -143,27 +143,27 @@ public class OSAPI implements ILuaAPI {
|
||||
|
||||
/**
|
||||
* Starts a timer that will run for the specified number of seconds. Once
|
||||
* the timer fires, a {@code timer} event will be added to the queue with
|
||||
* the ID returned from this function as the first parameter.
|
||||
* the timer fires, a [`timer`] event will be added to the queue with the ID
|
||||
* returned from this function as the first parameter.
|
||||
* <p>
|
||||
* As with [sleep][`os.sleep`], {@code timer} will automatically be rounded up
|
||||
* to the nearest multiple of 0.05 seconds, as it waits for a fixed amount
|
||||
* of world ticks.
|
||||
* As with [sleep][`os.sleep`], the time will automatically be rounded up to
|
||||
* the nearest multiple of 0.05 seconds, as it waits for a fixed amount of
|
||||
* world ticks.
|
||||
*
|
||||
* @param timer The number of seconds until the timer fires.
|
||||
* @return The ID of the new timer. This can be used to filter the
|
||||
* {@code timer} event, or {@link #cancelTimer cancel the timer}.
|
||||
* @param time The number of seconds until the timer fires.
|
||||
* @return The ID of the new timer. This can be used to filter the [`timer`]
|
||||
* event, or {@linkplain #cancelTimer cancel the timer}.
|
||||
* @throws LuaException If the time is below zero.
|
||||
* @see #cancelTimer To cancel a timer.
|
||||
*/
|
||||
@LuaFunction
|
||||
public final int startTimer(double timer) throws LuaException {
|
||||
return apiEnvironment.startTimer(Math.round(checkFinite(0, timer) / 0.05));
|
||||
public final int startTimer(double time) throws LuaException {
|
||||
return apiEnvironment.startTimer(Math.round(checkFinite(0, time) / 0.05));
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a timer previously started with startTimer. This will stop the
|
||||
* timer from firing.
|
||||
* Cancels a timer previously started with {@link #startTimer(double)}. This
|
||||
* will stop the timer from firing.
|
||||
*
|
||||
* @param token The ID of the timer to cancel.
|
||||
* @cc.since 1.6
|
||||
@ -399,10 +399,9 @@ public class OSAPI implements ILuaAPI {
|
||||
* Returns a date string (or table) using a specified format string and
|
||||
* optional time to format.
|
||||
* <p>
|
||||
* The format string takes the same formats as C's {@code strftime} function
|
||||
* (http://www.cplusplus.com/reference/ctime/strftime/). In extension, it
|
||||
* can be prefixed with an exclamation mark ({@code !}) to use UTC time
|
||||
* instead of the server's local timezone.
|
||||
* The format string takes the same formats as C's [strftime](http://www.cplusplus.com/reference/ctime/strftime/)
|
||||
* function. The format string can also be prefixed with an exclamation mark
|
||||
* ({@code !}) to use UTC time instead of the server's local timezone.
|
||||
* <p>
|
||||
* If the format is exactly {@code *t} (optionally prefixed with {@code !}), a
|
||||
* table will be returned instead. This table has fields for the year, month,
|
||||
|
Loading…
Reference in New Issue
Block a user