QtCraft API C++ classes QML types Handbook

QcFireIgnition Class

What lights fire besides fire itself (decision E-393). More...

Header: #include <server/blocks/QcFireIgnition.h>

Public Types

Light

Public Functions

void blockUpdated(QcBlockPos pos, QcBlockId block)
int lightning(QcBlockPos pos, int sparks)
void setLight(QcFireIgnition::Light light)
bool strike(QcBlockPos pos)
const QcFireRules::Table &table() const
bool use(QcServerClient &client, const QcMsg::UseItem &message)

Detailed Description

Every new fire goes through QcServerFire::ignite: a spark of its own with the full guarantees of decision E-392 (only in air of a loaded chunk where fire may stand, within the caps of chunk and world, with its own spread radius around the spark).

Member Type Documentation

[alias] QcFireIgnition::Light

Lights the explosive at a position (QcServerExplosions::light); false when there is none.

Member Function Documentation

void QcFireIgnition::blockUpdated(QcBlockPos pos, QcBlockId block)

A block update of block at pos: a block with sparks may light a cell next to it.

int QcFireIgnition::lightning(QcBlockPos pos, int sparks)

Lightning struck the cell pos: lights it and up to sparks - 1 cells in the 3 × 3 × 3 around it (drawn from the seed, the position and the tick), at most sparks fires in all and none while fire does not spread (game rule fireSpread, fireSpreadRadius 0). Returns the fires lit.

void QcFireIgnition::setLight(QcFireIgnition::Light light)

Sets light, with which flint and steel used on an explosive, or a dispenser striking at one, lights it (decision E-601).

bool QcFireIgnition::strike(QcBlockPos pos)

Lights fire at pos for an igniting item (player or dispenser), or the explosive standing there; plays the striking sound. Returns whether something was lit.

const QcFireRules::Table &QcFireIgnition::table() const

Returns the fire traits of the content's block states.

bool QcFireIgnition::use(QcServerClient &client, const QcMsg::UseItem &message)

Handles a use of the held item of client on message.target (message). Returns false when the held item does not ignite (the use is something else). A use that lights nothing (no room, out of reach) still returns true.