QtCraft API C++ classes QML types Handbook

QcMinecartHoppers Class

How items move between minecarts and the blocks around them (decision E-387), once per tick after the carts moved, for awake carts only. More...

Header: #include <server/minecarts/QcMinecartHoppers.h>

Public Types

struct Stats

Public Functions

void forgetTick()
const QcMinecartHoppers::Stats &lastTick() const
void tick()

Static Public Members

int slotFor(const QList<QcItemStack> &stacks, const QcItemStack &unit, int maxStack)

Detailed Description

The moves:

Who acts and what moves follows the hoppers of decision E-344 (first slot that fits, the hoppers' cooldown after a move from QcServerLimits). Carts act in the order of their ids, so nothing about places or directions decides; at most QcServerLimits::hopperBudget carts act per tick, the next tick goes on after the last one.

Member Function Documentation

void QcMinecartHoppers::forgetTick()

A tick without carts: nothing acted and nothing moved.

const QcMinecartHoppers::Stats &QcMinecartHoppers::lastTick() const

Returns what the carts did in the latest tick.

[static] int QcMinecartHoppers::slotFor(const QList<QcItemStack> &stacks, const QcItemStack &unit, int maxStack)

Returns the slot of stacks that takes one more of unit's item with stacks of at most maxStack, or -1 (first that fits).

void QcMinecartHoppers::tick()

Moves the items of one server tick.