content library
Game content on package:voxel_engine/core.dart: block and item
registries by string id, tags, mining times, inventories, crafting recipes,
loot tables, status effects, what eating, wearing, pouring, gliding or
shooting with an item does, and what an item looks like.
Classes
- Armor
- Armour: worn in one slot, it turns aside points of every blow.
-
BlockRegistry<
T extends BlockType> - A game's blocks, numbered in the order given. The number is the save contract: a chunk stores one byte per cell, so blocks are appended, never reordered or removed. Entry 0 is air.
- BlockType
-
One block of a game, named by string. The engine sees it through the
VoxelBlockTable a
BlockRegistryprojects; everything else here is the game's (hardness, tools, drops, tags). - Bucket
- What a bucket does with a liquid. An empty one scoops a liquid's source, leaving air, and becomes the full item fills names for that liquid; a full one pours its liquid where it is aimed and becomes its empties.
- CustomItemShape
-
A game's own shape: boxes of voxels, each filled from its first corner
to its second (inclusive) in a
0xRRGGBBcolour, a later box painting over an earlier one; held by the voxel hold as grip says, each voxel scale metres. A flat piece is drawn in the XY plane, standing up +Y from hold. - EffectEvent
- What one tick of an effect did; the owner decides how it shows.
- EffectRow
- One active effect: seconds left and power.
- EffectType
- One timed buff or debuff. With a period it ticks: every period seconds it deals damage and heals heal, times its power. Its stats bend named stats while it lasts.
- Facing
- The variants of a block that turns to face the way it was placed: stairs that climb away from the player, a door across the way they walk. Each variant is a block of its own, named here by id.
- Food
- What eating or drinking an item does: hunger it fills, health it gives back, an effect it starts, and an item it leaves in the hand (a bowl, a bottle).
- Glider
- What an item that glides does: carried in the bag, held glide in the air caps the fall at fall and carries the body toward the look at speed, steering at steer (a hang glider, wings).
- Growth
- How a crop grows: after seconds lit by at least minLight (sky or block light, 0..15) it becomes the block into, its next stage. The last stage has no growth.
- Inventory
- Slots of ItemStacks, the first hotbarSize of them the hotbar. How many of an item fit a slot and how long it lasts are the game's, asked through stackSize and maxDurability.
- ItemModel
- An item's look, built: the voxels its ItemShape paints in its colours, the point it is held by (origin), how (grip) and the metres of a voxel (scale). Built once a look (of): two items that look alike are one model, so whatever is made from it (a mesh, an icon) is made once for both.
-
ItemRegistry<
T extends ItemType> - A game's items by id.
- ItemShape
- What an item looks like wherever it is drawn: in the hand, held by a body, lying on the ground, in a slot. One of the StockItemShapes painted in the item's colours, or a CustomItemShape of the game's own voxels.
- ItemStack
- One inventory slot's worth: an item, how many, and what is particular to this stack (its wear, a rolled bonus).
- ItemType
- One item of a game. A block's item names that block in block; one that is eaten says what it does in food, one that is worn in armor, one that carries a liquid in bucket, one that glides in glider, one that shoots in launcher, one that lights the way in hand in light. What it looks like is its shape.
- Launcher
- What an item that shoots does: a press of attack with it in hand looses one shot, spending one ammo from the bag, at most once every cooldown seconds. A bow shoots arrows; a game's staff, shooting bolts that cost no item, has no ammo.
- LootEntry
- One row of a LootTable: chance to appear at all, then min..max of item.
- LootTable
- What a chest, a mob or a fishing line gives: every entry rolled once, in order, or one of them (LootTable.oneOf).
- MiningRules
- How long blocks take to break: a block's hardness, divided by the speed of the right tool's tier.
- Recipe
-
One recipe: ingredients (item id to count) make count of result at
station (
''by hand). Shapeless: only the counts matter. - RecipeBook
- A game's recipes.
- StatModifier
- How an effect bends one stat, per point of its power.
- StatusEffects
- The effects on one body. Ticking damage and healing come back from tick as events, so the owner applies and shows them.
- Storage
- What a block that stores things holds (a chest): its slots, and the loot a generated one is found with. One a player places starts empty.
- Support
- What a block must lean on to stay: a torch on the floor, a wall torch or a ladder on a wall, a crop on farmland. Once that neighbour is gone the block breaks and drops, and a player cannot place it where it would not stand.
Enums
- ItemGrip
- How an item is held, and so how its icon is turned to the eye.
- StockItemShape
-
The kit's shapes, painted in the item's colours. Reach them through
ItemShape's constants (
ItemShape.pickaxe).