QcServerStands Class
What players do to armour stands (decision E-238): placing one from its item, putting armour and the held item on or taking them off, and breaking it (two quick hits) with its drops. More...
| Header: | #include <server/gameplay/QcServerStands.h> |
Public Functions
| void | breakStand(quint32 id, bool drops) |
| void | changed(const QcArmourStand &stand) |
| void | dropReplaced(const QcArmourStand &before, const QcArmourStand &after) |
| bool | hit(QcServerClient &client, quint32 id) |
| bool | place(QcServerClient &client, const QcMsg::UseItem &message) |
| QcArmourStand * | spawn(QcArmourStand stand) |
| void | tick() |
| bool | use(QcServerClient &client, quint32 id) |
Static Public Members
| float | facingYaw(float playerYaw) |
| QcEquipmentSlot | slotAtHeight(double height) |
| const float | yawStep |
Detailed Description
Member Function Documentation
void QcServerStands::breakStand(quint32 id, bool drops)
Removes the stand id; with drops its item, armour and held item fall where it stood.
void QcServerStands::changed(const QcArmourStand &stand)
Everyone who sees stand gets it again.
void QcServerStands::dropReplaced(const QcArmourStand &before, const QcArmourStand &after)
Drops the armour and held item before had and after no longer has (a command replaced or cleared them) where the stand stands.
[static] float QcServerStands::facingYaw(float playerYaw)
Returns the yaw a stand placed by a player looking along playerYaw gets: facing the player, in yawStep steps.
bool QcServerStands::hit(QcServerClient &client, quint32 id)
Handles a hit of client on the stand id (none in adventure mode). Returns false when id is no stand.
bool QcServerStands::place(QcServerClient &client, const QcMsg::UseItem &message)
Places a stand from the held item of client on top of the block message clicked. Returns false when the item places no stand. A refused placement (no room, too far, limit) still returns true.
[static] QcEquipmentSlot QcServerStands::slotAtHeight(double height)
Returns the equipment slot of the body part at height metres above the feet of a full-size stand.
QcArmourStand *QcServerStands::spawn(QcArmourStand stand)
Adds stand (commands, world setup); its id is assigned here. Returns it, or null when the limit is reached.
void QcServerStands::tick()
The stands' hit timers in a simulated tick (and stands in the void go).
bool QcServerStands::use(QcServerClient &client, quint32 id)
Handles a right click of client on the stand id. Returns false when id is no stand.
Member Variable Documentation
const float QcServerStands::yawStep
Stands are turned to face the player in steps of this many degrees.