QtCraft API C++ classes QML types Handbook

QcServerExplosions Class

Explosives and explosions in the server tick (decisions E-600 to E-604). More...

Header: #include <server/explosions/QcServerExplosions.h>

Public Types

struct Blast
struct Numbers

Public Functions

quint64 blocksBroken() const
bool breaksBlocks() const
void explode(const QcServerExplosions::Blast &blast)
bool isExplosive(QcBlockId block) const
bool light(QcBlockPos pos, std::optional<int> fuse = std::nullopt)
const QcServerExplosions::Numbers &numbers() const
const QcBlastTable &table() const
void tick()
qsizetype waitingCells() const

Static Public Members

const double viewDistance

Detailed Description

Member Function Documentation

quint64 QcServerExplosions::blocksBroken() const

Returns the blocks blasts broke since the server started.

bool QcServerExplosions::breaksBlocks() const

Returns whether explosions break blocks now: the game rule explosionBlockDamage.

void QcServerExplosions::explode(const QcServerExplosions::Blast &blast)

Sets off blast now (tests, commands and later creatures; lit explosives go through tick()).

bool QcServerExplosions::isExplosive(QcBlockId block) const

Returns whether block is an explosive.

bool QcServerExplosions::light(QcBlockPos pos, std::optional<int> fuse = std::nullopt)

Lights the explosive block at pos with its own fuse (or fuse ticks). Returns false when the cell holds no explosive, its chunk is not loaded or the table of lit explosives is full.

const QcServerExplosions::Numbers &QcServerExplosions::numbers() const

Returns the counts since the server started.

const QcBlastTable &QcServerExplosions::table() const

Returns the blast traits of the block states.

void QcServerExplosions::tick()

Counts the fuses down, sets off the due explosives and works through the waiting cells.

qsizetype QcServerExplosions::waitingCells() const

Returns the cells waiting to be broken.

Member Variable Documentation

const double QcServerExplosions::viewDistance

Clients hear and see an explosion this far away.