QcFireIgnition Class
What lights fire besides fire itself (decision E-393). More...
| Header: | #include <server/blocks/QcFireIgnition.h> |
Public Types
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).
- Flint and steel (an item that
ignites) used on a block face lights the cell in front of the face; it wears by one per fire, except in creative mode. Dispensers use it the same way (QcDispenserActions). - A block with
sparks(lava) lights, with that chance in 100 per block update of it, one air cell right next to it that touches a flammable block. The updates come anyway (something next to the lava changed, or it flowed), so the cost follows them and not the size of the world; a lava lake at rest lights nothing. - Lightning (decision E-396) lights the struck cell and, picked by dice, a few cells right around it: at most
sparksfires per strike, only while fire spreads, each a spark of its own.
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.