QtCraft API C++ classes QML types Handbook

QcNoteInstruments Struct

The instruments of a note block (decision E-767): the sound it plays for the block below it, by that block's name, else by its sound material, else fallback. More...

Header: #include <common/content/blockbehaviour/QcSignalDefinition.h>

Public Functions

QString of(const QString &block, const QString &soundMaterial) const

Public Variables

QHash<QString, QString> byBlock
QHash<QString, QString> bySound
QString fallback
enum class QcComparatorReading { None, Contents, Property, Carts, Bites }
enum class QcPistonMobility { Default, Push, Immovable, Breaks }
enum class QcSignalKind { None, Dust, Lever, Button, Plate, …, Viewers }
const int qcSignalKindCount

Detailed Description

Names and sounds are qualified.

Member Function Documentation

QString QcNoteInstruments::of(const QString &block, const QString &soundMaterial) const

Returns the sound for the block block below with the sound material soundMaterial.

Member Variable Documentation

QHash<QString, QString> QcNoteInstruments::byBlock

Sound by name of the block below ("blocks", at most QcSignalDefinition::maxInstruments).

QHash<QString, QString> QcNoteInstruments::bySound

Sound by sound material of the block below ("sounds", at most QcSignalDefinition::maxInstruments).

QString QcNoteInstruments::fallback

Sound for any other block below ("default").

Related Non-Members

enum class QcComparatorReading

What a Signal Comparator reads from a block behind it (decision E-343).

ConstantValueDescription
QcNoteInstruments::QcComparatorReading::None0Nothing to read (no \c {"comparator"}); the comparator takes the block's power.
QcNoteInstruments::QcComparatorReading::Contents1Fullness of the block's container or machine slots (the reference formula).
QcNoteInstruments::QcComparatorReading::Property2The index of the value of a state property, scaled to 0..15.
QcNoteInstruments::QcComparatorReading::Carts3The fullness of a container minecart on the block (a detector rail, decision E-385); without one the comparator takes the block's power as usual.
QcNoteInstruments::QcComparatorReading::Bites4Twice the bites left of a block eaten bite by bite (cake: 14 whole, 2 for the last bite; decision E-773).

enum class QcPistonMobility

How a block reacts to being pushed by a piston.

ConstantValueDescription
QcNoteInstruments::QcPistonMobility::Default0Derived from the block: unbreakable blocks stay, blocks that need support, washable ones, liquids and replaceable ones break, the rest moves.
QcNoteInstruments::QcPistonMobility::Push1Always moves (\c {"movable": "push"}).
QcNoteInstruments::QcPistonMobility::Immovable2Bedrock, obsidian, an extended piston: the piston cannot extend.
QcNoteInstruments::QcPistonMobility::Breaks3Breaks with its drops instead of moving.

enum class QcSignalKind

What a block does in Signal Dust circuits (decision E-333).

The kind selects the behaviour the server implements; the numbers tune it per block, so packs and mods add their own sources (levers, buttons, plates), conductors and consumers ("slots": lamps, openers, pistons) in data.

ConstantValueDescription
QcNoteInstruments::QcSignalKind::None0Not part of circuits.
QcNoteInstruments::QcSignalKind::Dust1The wire: carries strength 15 minus one per block, connects to neighbouring dust and components, climbs and descends blocks.
QcNoteInstruments::QcSignalKind::Lever2Sources a player switches: a lever stays, a button springs back after pulseTicks.
QcNoteInstruments::QcSignalKind::Button3A source that springs back after \c {pulseTicks}.
QcNoteInstruments::QcSignalKind::Plate4Pressed while something stands on it (detectsItems: any entity, else players and creatures).
QcNoteInstruments::QcSignalKind::Torch5An inverter on a block: lit unless its block is powered; burns out on too fast clocks.
QcNoteInstruments::QcSignalKind::Repeater6A diode with 1 to 4 steps of delay from back to front; side inputs of powered repeaters lock it.
QcNoteInstruments::QcSignalKind::Lamp7Slots: a lamp lights while powered; an opener (door, trapdoor, gate) opens on rising and closes on falling power; a piston pushes up to pushLimit blocks and pulls one back when sticky.
QcNoteInstruments::QcSignalKind::Opener8A door, trapdoor or gate that opens on rising and closes on falling power.
QcNoteInstruments::QcSignalKind::Piston9Pushes up to \c {pushLimit} blocks while powered; pulls one back when sticky.
QcNoteInstruments::QcSignalKind::PistonHead10The head of an extended piston; it belongs to the piston behind it.
QcNoteInstruments::QcSignalKind::Comparator11Stage 29.2 (decision E-342 ff.). A diode that reads the block behind it (container fullness, readable blocks) and compares or subtracts its side inputs.
QcNoteInstruments::QcSignalKind::Observer12Sends a pulse out of its back when the block state in front of it changes.
QcNoteInstruments::QcSignalKind::Hopper13Moves items between containers; any power locks it.
QcNoteInstruments::QcSignalKind::Dispenser14On rising power ejects one item after a short delay: uses it (usesItems, dispenser) or throws it (dropper); both put it into a container in front.
QcNoteInstruments::QcSignalKind::Rail15Stage 32.2 (decision E-384). A rail slot (powered and activator rails): powered while it gets power or while a rail of the same block at most railReach rails along its line gets power.
QcNoteInstruments::QcSignalKind::Igniter16Stage 51.2 (decision E-601). A slot that primes the explosive it is (QcBlastDefinition) as soon as it gets power.
QcNoteInstruments::QcSignalKind::Constant17A source that is always on (a block of Signal Dust, decision E-752): it gives power to the dust and components on all six sides, but never powers or conducts through the blocks next to it.
QcNoteInstruments::QcSignalKind::Note18A slot that plays a note when its power rises (decision E-767); using it raises the pitch by a semitone. Its instrument comes from the block below (QcNoteInstruments).
QcNoteInstruments::QcSignalKind::Target19A source with the strength of its state power, set by a projectile hitting it (the closer to the centre of the face, the stronger) and released after a short time (decision E-768). Like constant it powers dust and components on all sides, but no block.
QcNoteInstruments::QcSignalKind::Hook20Stage 62.3 (decision E-782). A tripwire hook on the side of a block: a source like a button while powered (strongly into the block it hangs on). It is attached while a hook facing it waits at most wireReach cells of tripwire away; then both are powered while something touches the wire between them.
QcNoteInstruments::QcSignalKind::Tripwire21The wire between two hooks: powered while an entity touches it (released when nothing has for pulseTicks), attached while it belongs to a line of two hooks, disarmed once shears cut it (it then breaks without setting the hooks off).
QcNoteInstruments::QcSignalKind::Viewers22A source with the strength of its state power, the number of players looking into the container (the trapped chest, decision E-783): it powers dust and components on all sides and the block below it strongly.

const int qcSignalKindCount

Number of values of QcSignalKind.