QtCraft API C++ classes QML types Handbook

QcTickControl Class

Whether a tick simulates the world (decision E-249). More...

Header: #include <server/tick/QcTickControl.h>

Public Functions

bool frozen() const
quint64 pendingSteps() const
void setFrozen(bool frozen)
bool simulateNext()
void step(quint64 ticks)

Static Public Members

const quint64 maxSteps

Detailed Description

A frozen world keeps ticking for the players (their movement, chunks, entity and time messages, saving) but runs none of the simulation: no time of day, block updates, liquids, creatures (spawning included), items, plants, falling blocks, machines or hunger. /tick step lets a number of ticks simulate while frozen. Not saved: a world always opens unfrozen.

Member Function Documentation

bool QcTickControl::frozen() const

Returns whether the world is frozen.

See also setFrozen().

quint64 QcTickControl::pendingSteps() const

Returns the ticks still to simulate while frozen.

void QcTickControl::setFrozen(bool frozen)

Freezes the world or lets it run (frozen); pending steps are dropped.

See also frozen().

bool QcTickControl::simulateNext()

Returns whether the next tick simulates; takes one step while frozen.

void QcTickControl::step(quint64 ticks)

Adds ticks to simulate while frozen (at most maxSteps pending).

Member Variable Documentation

const quint64 QcTickControl::maxSteps

Most ticks one /tick step asks for (five minutes of game time).