QcServerKitchen Class
Cake and campfires in the server (decisions E-772, E-773). More...
| Header: | #include <server/machines/QcServerKitchen.h> |
Public Functions
Static Public Members
| QcMsg::CampfireDisplay | displayOf(const QcServerWorld &world, QcBlockPos pos) |
Detailed Description
Using cake eats one bite of it when the player is hungry; the last bite removes it. Using a lit campfire with an item it can cook puts one item on it (QcCampfires); a shovel or a bucket of a liquid that does not burn puts it out (its block becomes extinguishesInto, the items on it drop), and an unlit one is lit again by flint and steel, a dispenser or fire (light()). In the tick the items cook for the campfire's time and drop beside it when done, and clients that have the chunk hear what lies on each campfire (QcMsg::CampfireDisplay).
Member Function Documentation
[static] QcMsg::CampfireDisplay QcServerKitchen::displayOf(const QcServerWorld &world, QcBlockPos pos)
Returns what lies on the campfire at pos of world.
bool QcServerKitchen::light(QcBlockPos pos)
Lights the unlit campfire at pos. Returns false when there is none.
void QcServerKitchen::tick()
Cooks the items on the campfires and tells the clients what changed.
bool QcServerKitchen::use(QcServerClient &client, QcBlockPos pos)
Handles a use of the held item of client on the block at pos (not sneaking, within reach). Returns false when it is none of the uses above, so the item acts as usual.