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:
- a hopper cart that is enabled (no powered activator rail turned it off) and rested pulls one item from the container above the cell of its feet, or, without a container there, picks up the item entities lying in that cell or the one above (as much of a stack as fits);
- a Signal Hopper whose pickup cell (the cell above it, where a cart on a rail over it stands) holds a container cart pulls one item from it, if no power locks the hopper and its cooldown ended.
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.