Class Game
-
Method Summary
Modifier and TypeMethodDescriptionThe selected profile-backed tab name, or null when the tab cannot be read.intintThe game's tick counter, or-1when the read cannot be served.booleanbooleanbooleanObserved instance state, or null when its mapped field/read is unavailable.Observed run mode, or null when its mapped field/read is unavailable.Observed run energy in percent (0..100), or null when unavailable or invalid.observedTicksSince(int earlierTick) Ticks elapsed sinceearlierTick(a value an earliertick()returned).booleanOpen a named side tab.voidsetRun(boolean enabled) Toggles run when the current state is readable and differs, by clicking this server's run orb.tick()The game's tick counter (one per 600 ms server tick), with "cannot read" kept apart:getTickCount()answers -1 for that, which tick arithmetic easily mistakes for a number.intticksSince(int earlierTick) Primitive form ofobservedTicksSince(int): the elapsed ticks, or-1when unknown.
-
Method Details
-
currentTab
The selected profile-backed tab name, or null when the tab cannot be read. -
openTab
Open a named side tab. Acceptance is confirmed by a subsequent currentTab() read. -
getServerName
- Returns:
- the server's display name ("Elorin", "Impact"), or "" without an adapter
-
isLoggedIn
public boolean isLoggedIn()- Returns:
- the adapter's logged-in read
-
getTickCount
public int getTickCount()The game's tick counter, or-1when the read cannot be served.GameThread.ensure(java.util.function.Supplier<T>, T)answersnullwhen it drops a read rather than guessing - a stalled render loop, a two-second marshal that did not complete. This method returned thatIntegeras anint, so an unreadable clock did not read as unknown: it threw a NullPointerException. In a workflow that exception surfaced as"Phase 'Main': condition error: null", the stage was skipped, and a flow whose only rule was gated on a timer parked for the whole session without ever acting.Callers doing tick arithmetic should treat a negative answer as "unknown" rather than as a tick number.
-
isInInstance
public boolean isInInstance()- Returns:
- whether the client reports an instanced region; false when unreadable (see
observedInInstance())
-
observedInInstance
Observed instance state, or null when its mapped field/read is unavailable. -
observedRunEnabled
Observed run mode, or null when its mapped field/read is unavailable. -
observedRunEnergy
Observed run energy in percent (0..100), or null when unavailable or invalid. -
isRunEnabled
public boolean isRunEnabled()- Returns:
- whether run is on; false when unreadable (see
observedRunEnabled())
-
setRun
public void setRun(boolean enabled) Toggles run when the current state is readable and differs, by clicking this server's run orb. Does nothing when the state cannot be read. Verify withobservedRunEnabled().- Parameters:
enabled- the wanted state
-
getRunEnergy
public int getRunEnergy()- Returns:
- run energy 0..100; 0 when unreadable (see
observedRunEnergy())
-
tick
The game's tick counter (one per 600 ms server tick), with "cannot read" kept apart:getTickCount()answers -1 for that, which tick arithmetic easily mistakes for a number.On Impact, Elorin and SpawnPK it counts the client's own ticks (on Impact, derived from the game cycle), not the server-aligned GameTick events a plugin receives; use it for elapsed-tick arithmetic, not as an id shared with another client.
- Returns:
- the current tick count; UNREADABLE when the read was dropped or the client has none
-
observedTicksSince
Ticks elapsed sinceearlierTick(a value an earliertick()returned).- Parameters:
earlierTick- a tick read earlier; negative means "never recorded"- Returns:
- the elapsed ticks; UNREADABLE when the current tick cannot be read or
earlierTickis negative
-
ticksSince
public int ticksSince(int earlierTick) Primitive form ofobservedTicksSince(int): the elapsed ticks, or-1when unknown. Treat a negative answer as "unknown", never as "no time passed".- Parameters:
earlierTick- a tick read earlier; negative means "never recorded"- Returns:
- elapsed ticks, or -1
-