QcBlockEntityRecord Struct
What is saved of the block entities of one chunk (decision E-358), with every tick counted from the moment of saving, so clocks go on where they stopped when the world opens again. More...
| Header: | #include <server/storage/QcBlockEntityRecord.h> |
Public Types
| struct | Memory |
| struct | Scheduled |
| enum class | Table { Containers, Machines, Saplings, Memories, Scheduled, …, Signs } |
Public Functions
| bool | isEmpty() const |
| void | pruneKept() |
| void | takeFrom(QcBlockEntities &entities, QcCircuitState &circuits, QcHopperQueue &hoppers, quint64 now) |
Public Variables
| QList<QcBlockPos> | blockUpdates |
| QList<QcCampfires::Entry> | campfires |
| QcChunkPos | chunk |
| QList<QcBlockEntities::Container> | containers |
| QList<QcFireQueue::Saved> | fires |
| bool | furnished |
| QcBlockEntityKept | kept |
| QList<QcBlockEntities::Machine> | machines |
| QList<QcBlockEntityRecord::Memory> | memories |
| QList<QcBlockEntities::Sapling> | saplings |
| QList<QcBlockEntityRecord::Scheduled> | scheduled |
| QList<QcBlockPos> | signalWakes |
| QList<QcSignTexts::Entry> | signs |
| QList<QcSpawners::Entry> | spawners |
| QList<QcBlockPos> | wakes |
Detailed Description
Member Type Documentation
enum class QcBlockEntityRecord::Table
The ids of the tables of a chunk's block entities (decision E-440); a later version adds ids below QcComponentFrames::firstModId, a mod from it on; none is ever reused.
| Constant | Value | Description |
|---|---|---|
QcBlockEntityRecord::Table::Containers | 1 | Containers with contents (containers). |
QcBlockEntityRecord::Table::Machines | 2 | Machines with contents or a cooldown (machines). |
QcBlockEntityRecord::Table::Saplings | 3 | Growing saplings (saplings). |
QcBlockEntityRecord::Table::Memories | 4 | What circuit components remember (memories). |
QcBlockEntityRecord::Table::Scheduled | 5 | Scheduled ticks of circuit components (scheduled). |
QcBlockEntityRecord::Table::Wakes | 6 | Positions the circuits were going to look at (wakes). |
QcBlockEntityRecord::Table::SignalWakes | 7 | Signals that were on their way (signalWakes). |
QcBlockEntityRecord::Table::BlockUpdates | 8 | Pending neighbour updates and flow steps (blockUpdates). |
QcBlockEntityRecord::Table::Fires | 9 | Burning fires (fires). |
QcBlockEntityRecord::Table::Spawners | 10 | Monster spawners (decision E-520): kind, delay and confined per spawner. |
QcBlockEntityRecord::Table::Furnished | 11 | A marker without entries: the chunk's generated block entities were put in (decision E-520). |
QcBlockEntityRecord::Table::Campfires | 12 | The items on campfires (decision E-772) with their cooking time. |
QcBlockEntityRecord::Table::Signs | 13 | The text on signs (decision E-766): the lines per sign with text. |
Member Function Documentation
bool QcBlockEntityRecord::isEmpty() const
Returns whether the record holds nothing (no entries, not furnished, nothing kept).
void QcBlockEntityRecord::pruneKept()
Drops the kept tails of entries the record no longer holds (a container broken since it was read), once the record is complete (fires included): a tail goes back only with its entry.
void QcBlockEntityRecord::takeFrom(QcBlockEntities &entities, QcCircuitState &circuits, QcHopperQueue &hoppers, quint64 now)
Fills the record of a chunk that leaves the world (decision E-374), chunk, with everything of it taken out of entities, the work of circuits and the queue of hoppers, ticks counted from now; its kept parts, set by the caller, decide like in QcBlockEntityRecords::collect(). blockUpdates and fires are left to the caller. In QcBlockEntityRecords.cpp.
Member Variable Documentation
QList<QcBlockPos> QcBlockEntityRecord::blockUpdates
Neighbour updates and planned flow steps of the chunk not yet carried out when it was unloaded or saved (decision E-374); queued again when it comes back.
QList<QcCampfires::Entry> QcBlockEntityRecord::campfires
The items cooking on campfires (decision E-772).
QcChunkPos QcBlockEntityRecord::chunk
The chunk.
QList<QcBlockEntities::Container> QcBlockEntityRecord::containers
Containers with contents (or a cooldown); empty ones come back with their block. A container's readyAt holds the ticks left of a hopper's cooldown.
QList<QcFireQueue::Saved> QcBlockEntityRecord::fires
Burning fires with the ticks left to their next step (decision E-392), in the order of their steps.
bool QcBlockEntityRecord::furnished
The generator's chest loot and spawner kinds were put into the chunk (QcFurnishing); a chunk without the mark gets them when it arrives.
QcBlockEntityKept QcBlockEntityRecord::kept
What this version does not read, written back unchanged.
QList<QcBlockEntities::Machine> QcBlockEntityRecord::machines
Machines with contents (or a cooldown); empty ones come back with their block.
QList<QcBlockEntityRecord::Memory> QcBlockEntityRecord::memories
What circuit components remember.
QList<QcBlockEntities::Sapling> QcBlockEntityRecord::saplings
Saplings with the time left until they try to grow.
QList<QcBlockEntityRecord::Scheduled> QcBlockEntityRecord::scheduled
Scheduled ticks of circuit components.
QList<QcBlockPos> QcBlockEntityRecord::signalWakes
The same for signals that were on their way (decision E-376): they come back as signals.
QList<QcSignTexts::Entry> QcBlockEntityRecord::signs
Signs with text (decision E-766).
QList<QcSpawners::Entry> QcBlockEntityRecord::spawners
Monster spawners (decision E-520) with the ticks left to their next cycle.
QList<QcBlockPos> QcBlockEntityRecord::wakes
Positions the circuits were going to look at (changes not yet looked at, positions waiting for chunks): looked at again as changes when the chunk is back.