QtCraft API C++ classes QML types Handbook

QcContactDamage Class

Damage of the blocks a body touches (lava, fire, magma; contactDamage of the block data) and how long they set it alight (setsAlight, decision E-393): the strongest of the loaded blocks a box overlaps. More...

Header: #include <server/core/QcContactDamage.h>

Public Types

struct Touch

Public Functions

double in(const QcServerWorld &world, const QcAabb &box) const
bool isPossibleIn(const QcServerWorld &world) const
QcContactDamage::Touch touching(const QcServerWorld &world, const QcAabb &box) const

Detailed Description

Only sections marked with the trait ContactDamage (QcSectionMarks) are looked at, so a world without such blocks costs nothing.

Member Function Documentation

double QcContactDamage::in(const QcServerWorld &world, const QcAabb &box) const

Returns the strongest contact damage of the loaded blocks of world that box overlaps, 0 for none.

bool QcContactDamage::isPossibleIn(const QcServerWorld &world) const

Returns whether any loaded chunk of world holds a block with contact damage at all.

QcContactDamage::Touch QcContactDamage::touching(const QcServerWorld &world, const QcAabb &box) const

Returns the strongest damage and the longest burning of the loaded blocks of world that box overlaps.