QtCraft API C++ classes QML types Handbook

QcPartGenerator Namespace

The registry function behind building parts: for every material of the registry and every part family of the material's kind, it registers the part's block (item follows from createBlockItems), its crafting recipe and its display names. More...

Header: #include <common/content/blocks/QcPartGenerator.h>

Functions

QStringList generate(QcContentRegistry &registry)
QString unsuitableBase(const QcContentRegistry &registry, const QString &block)

Detailed Description

Base game and mods use it alike, through materials/ and parts/ files (decision E-048).

Nothing is made for excluded materials: base blocks listed by an exclusion entry, and base blocks that are no plain building block (not an opaque solid full cube, liquid, with states, a machine, crafting table or storage, unbreakable, glowing or a sapling). A material leaves out the families in its exclude list. Parts never replace a block of the same name that was defined explicitly.

Function Documentation

QStringList QcPartGenerator::generate(QcContentRegistry &registry)

Generates all parts into registry; returns warnings about materials that could not be used.

QString QcPartGenerator::unsuitableBase(const QcContentRegistry &registry, const QString &block)

Returns why block of registry cannot be the base of building parts, or an empty string when it can.