WorldClockState class
The persistent state of a 26.3 world clock.
public sealed class WorldClockState
In Obsidian.API.
Remarks
A world's levels share its clocks, and commands change them from connection threads, so every change is atomic: the world's tick, a level skipping the night and a command never split one another.
Constructors
public WorldClockState();Properties
public float PartialTick { get; set; }public bool Paused { get; set; }public float Rate { get; set; }public long TotalTicks { get; set; }Methods
AddTicks(long)
public long AddTicks(long delta);Adds delta ticks to the time, never going below 0, and keeps the partial tick.
Returns
The new time.
public void SetTime(long ticks);Tick()
public void Tick();Matches ServerClockInstance's single-precision accumulation and floor at each tick.
TrySetTime(Func<long, long?>)
public long? TrySetTime(Func<long, long?> change);Sets the time from the time the clock has now, as one change: two levels skipping to the same marker at once skip once.
Parameters
change- The new time for the current one, or
nullto leave the clock as it is. A new time resets the partial tick, likeWorldClockState.SetTime.
Returns
The time set, or null when it was left as it is.