QtCraft API C++ classes QML types Handbook

QcBlockEntityExtras Class

What the loaded chunks keep about their block entities besides the entities themselves (part of QcServerWorld, decision E-716); saved with the chunk and forgotten with it. More...

Header: #include <server/blockentities/QcBlockEntityExtras.h>

Public Types

struct Tables

Public Functions

void dropOrphanTails(QcBlockPos pos, const QcBlockEntityExtras::Tables &tables)
void forgetChunk(QcChunkPos pos)
bool hasKeptParts() const
bool isFurnished(QcChunkPos pos) const
void keepParts(QcChunkPos pos, QcBlockEntityKept parts)
const QHash<QcChunkPos, QcBlockEntityKept> &keptParts() const
void noteFurnished(QcChunkPos pos)
QcBlockEntityKept takeParts(QcChunkPos pos)

Detailed Description

Furnished chunks had their generated block entities (the chests' loot, the spawners' kinds; decision E-520) put in once (QcFurnishing). Kept parts are what the saved block entities hold that this version does not read (decision E-440): unknown tables and tails of newer versions, written back when the chunk is saved or leaves the world (QcChunkLoading). The tail of an entry goes when a block set in the world ends the entry, so a block built anew at its place starts without it.

Member Function Documentation

void QcBlockEntityExtras::dropOrphanTails(QcBlockPos pos, const QcBlockEntityExtras::Tables &tables)

Drops the kept tails of the entries at pos that the block just set there ended, as tables tell: those whose container, machine, sapling, memory, fire, spawner, campfire or sign text is gone.

void QcBlockEntityExtras::forgetChunk(QcChunkPos pos)

Forgets the chunk at pos, which left the world or is generated again.

bool QcBlockEntityExtras::hasKeptParts() const

Returns whether any chunk keeps parts (a block set needs no check otherwise).

bool QcBlockEntityExtras::isFurnished(QcChunkPos pos) const

Returns whether the chunk at pos was furnished.

void QcBlockEntityExtras::keepParts(QcChunkPos pos, QcBlockEntityKept parts)

Holds parts for the loaded chunk at pos (nothing when they are empty).

const QHash<QcChunkPos, QcBlockEntityKept> &QcBlockEntityExtras::keptParts() const

Returns the kept parts of every loaded chunk that has some.

void QcBlockEntityExtras::noteFurnished(QcChunkPos pos)

Notes that the chunk at pos was furnished.

QcBlockEntityKept QcBlockEntityExtras::takeParts(QcChunkPos pos)

Returns the kept parts of the chunk at pos and forgets them.