QtCraft API C++ classes QML types Handbook

QcCrumbling Class

Creatures that crumble at a liquid's source (QcMobDefinition::crumbles, decision E-593; the sand golem in water), every game tick after the creatures moved: an awake one whose body (grown by touch sideways and below) reaches into a source block of its liquid is removed without loot or experience, and its build stands where it stood: body at its feet, in the middle above them and on both sides of the middle across its facing, head on the middle, facing where it looked. More...

Header: #include <server/guardians/QcCrumbling.h>

Public Functions

int crumbled() const
void tick()
bool touchesSource(const QcCreature &mob, const QcMobDefinition &definition, const QString &liquid) const

Static Public Members

QList<QcBlockPos> buildCells(QcBlockPos feet, double yaw)
const double touch

Detailed Description

Each block goes into an open cell (air, a replaceable block, flowing liquid; never a source) with the usual block updates (sand falls, and falling sand may fill a source below: a farm keeps its water out of the arms' way); a block without an open cell drops as an item there. A creature that may not change the world (QcCreature::mayGrief: the game rule mobGriefing off, confined, no mind; decision E-510) leaves its whole build as items. It counts what crumbled (tests, measurements).

Member Function Documentation

[static] QList<QcBlockPos> QcCrumbling::buildCells(QcBlockPos feet, double yaw)

Returns the cells of a crumbled build at feet: feet, middle, the two arms, the head; the arms across the facing of yaw (degrees, 0 north).

int QcCrumbling::crumbled() const

Returns the creatures that crumbled since the start.

void QcCrumbling::tick()

Lets the builds of the creatures that touch a source crumble (one tick).

bool QcCrumbling::touchesSource(const QcCreature &mob, const QcMobDefinition &definition, const QString &liquid) const

Returns whether the body of mob of the kind definition touches a source block of liquid (a block name).

Member Variable Documentation

const double QcCrumbling::touch

How far beyond its body a creature feels a source: a source beside it or under its feet counts.