QtCraft API C++ classes QML types Handbook

QcOpeners Class

Opens and closes doors, trapdoors and gates, for players and for circuits: both halves of a door together, with the block's sound, but never onto a living body (a player or creature inside the new shape keeps it as it is). More...

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

Public Functions

bool toggle(QcBlockPos pos, QcBlockId block)

Detailed Description

Member Function Documentation

bool QcOpeners::toggle(QcBlockPos pos, QcBlockId block)

Flips the open state of the opener block at pos. Returns false when the block at pos stays as it was (a body in the way, or the world refused the change), so a circuit tries again.