# Create A plan for porting all of Create to bworld as a mod, `mods/create`: its kinetics, processing, logistics, fluids, redstone, contraptions, trains, equipment, decoration and schematics. It aims to do this with as little hand work as possible, and to stay fast on both the server and the client when a world has thousands of moving parts. Built so far: the importer and Create's imported blocks and items, model `parent` and `x` turns, S0, and stonecutting from S9. Facts about Create come from reading `ports/create1.21.1` and `ports/create1.19.3`, and facts about bworld from its source. ## Sources | Copy | Version | Used for | | -------------------- | ------- | -------------------------------------------------------------------------------------------------------------------- | | `ports/create1.21.1` | 6.0.11 | **All code and data**: mechanics, numbers, recipes, tags, worldgen, ponder scripts | | `ports/create1.19.3` | 0.5.0.j | **Textures, models, blockstates, sounds and ponder scenes** from its `assets/` and `src/generated/resources/assets/` | 0.5.0.j shipped with only an MIT `LICENSE`, so its assets are used under that, with the MIT notice in `mods/create/CREDITS.md`. 6.0.11's `assets/` folder isn't in the copy and isn't used. **Keep the art removable.** Everything from 0.5.0.j's assets is written by the importer (below) into `mods/create/textures/` and `mods/create/models/`, and nothing else in the mod depends on a specific file being there. Removing the art is then deleting those two folders and re-running the importer with `--no-assets`. That writes placeholder models (a plain cube, or the block's shape) and a placeholder texture, and the mod still loads and plays. **Content newer than 0.5.0.j has no art to take**, so it needs new art either way. These are the blocks and items 6.0.11 registers that 0.5.0.j doesn't: the package logistics (`packager`, `repackager`, `package_frogport`, `stock_ticker`, `stock_link`, `redstone_requester`, `factory_gauge`, `package_filter`, `item_hatch`, `chain_conveyor`, cardboard and its blocks and armor, table cloths, `shopping_list`), `large_water_wheel`, `elevator_pulley`, `elevator_contact`, `contraption_controls`, `mechanical_roller`, the copycats, `clipboard`, `desk_bell`, `pulse_timer`, metal doors and scaffolding, `andesite_alloy_block`, `industrial_iron_block`, `weathered_iron_block`, `experience_block`, netherite diving gear. The importer lists them in its report. ## How Big Create Is 6.0.11 is 2017 Java files, about 275,000 lines. By part: | Part | Lines | What | | --------------------------- | ------ | ------------------------------------------------------------------------------- | | `content/kinetics` | 36,000 | Shafts, cogs, gearboxes, generators, belts, and the machines that use rotation | | `infrastructure` | 33,000 | Config, datagen, ponder scenes, commands | | `content/trains` | 30,000 | Tracks, the track graph, signals, stations, schedules, train entities | | `content/logistics` | 30,000 | Funnels, tunnels, chutes, depots, vaults, filters, and 6.0's packages | | `content/contraptions` | 27,000 | Moving block structures: bearings, pistons, pulleys, gantries, actors | | `content/equipment` | 17,000 | Wrench, goggles, potato cannon, backtank, toolbox, symmetry wand | | `content/redstone` | 12,000 | Links, nixie tubes, display links, threshold switch, diodes | | `content/fluids` | 12,000 | Pipes, pumps, tanks, spouts, drains, hose pulley, boilers | | `compat` | 10,000 | Other mods. Only the JEI part matters, for the recipe viewer | | `content/decoration` | 7,000 | Palettes, copycats, girders, sliding doors, placards | | `content/schematics` | 7,000 | Schematic table, schematicannon | | `content/processing` | 5,000 | Basin, blaze burner, sequenced assembly, the processing recipe base | | `foundation`, `api`, `impl` | 40,000 | Block entity behaviours, connected textures, GUI, networking, rendering helpers | Data in 6.0.11: 188 blocks and 60 items registered one by one (plus generated families like palettes), and 1881 recipes in 19 types. Art in 0.5.0.j: 1043 generated and 573 hand-made block models, 1006 textures, 92 connected texture sheets, 153 ponder scenes. A straight line-by-line translation would be most of a year of work and would carry over things bworld doesn't need, like datagen, mixins, compat and Forge plumbing. The plan below is built to avoid that. ## Strategy Six rules that keep the work small: 1. **Import data, don't hand-write it.** One tool converts Create's models, textures, blockstates, recipes, tags, loot, names and worldgen into bworld's formats, and reports what it couldn't convert. Hundreds of blocks then cost the same as one, and re-running it after a fix redoes all of them. This replaces Create's datagen entirely. 2. **Port Create's architecture onto bworld's, not its classes.** Create builds every machine from a few shared pieces (block entity behaviours, a rotation network, processing recipes, instance types). Each piece becomes one bworld piece, and then the machines are mostly data plus a little code (see [Architecture](#architecture)). 3. **Put general features in the engine, once.** Block capabilities, fluids, redstone, instanced rendering and moving block structures are things any mod could use. They go in the engine shaped like NeoForge's (check `ports/neoforge`), and Create is their first user. 4. **Change-driven server work.** Rotation, pipes and belts are networks that only recompute when something in them changes. Blocks that have nothing to do don't tick. 5. **GPU-driven animation.** A turning part is uploaded once with its axis, speed and offset, and the vertex shader turns it from the time, like Create's `rotating` instance type. Nothing is sent or computed per frame for something that turns at a steady speed. 6. **Playable in phases.** Each phase ends with something to use in a world and tests passing, in an order where every phase only needs the ones before it. ## The Importer A generic tool for any Minecraft Java mod, `tools/importer.ts`, not one for Create. It converts one kind of resource at a time, from a single file or a whole folder: ```sh deno run -A tools/importer.ts model MODEL.json --output PATH # one model, printed without --output deno run -A tools/importer.ts model path/to/resources --output DIR # every assets//models in it ``` A folder can be a mod's whole resources, one `assets//models`, or a folder inside one, and the output keeps the same folders. `--parents FOLDER` adds other resources to follow parents through (to tell sprites and OBJ models apart), and `--remap FILE` renames locations before they become ids. Every kind reports what it converted, what it skipped and why, and what's wrong, and exits with an error when anything is. **Ids.** A resource location becomes a bworld id by joining its folders with `_`, the same rule `check-mods` uses for textures in subfolders: `create:block/cogwheel` is `create:block_cogwheel`, for its model and its texture alike. It's a pure function of the location, so every kind agrees on ids without sharing state: a blockstate pointing at a model writes the same id the model was written with. Two locations that join to the same id are an error, fixed with `--remap`. **Remaps** are prefix rules, longest first, and a `skip` list of patterns for locations to leave out of every kind: `{ "textures": { "minecraft:block/": "bworld:" }, "models": {}, "ids": {}, "tags": {} }`. The defaults map Minecraft's block and item textures, its blocks and items (`ids`) and its tags to the base game's of the same name, and Forge's shared tags to `c`, which is what bworld calls them. A mod's remap file is where its other vanilla ids go. **Kinds:** | Kind | Java | bworld | Status | | ------------ | -------------------------------------------- | ---------------------------------------------------------------------- | ------ | | `model` | `assets/*/models/**.json` | `models/`, parents kept, faces renamed, Blockbench extras dropped | Built | | `texture` | `assets/*/textures/**.png` and `.png.mcmeta` | `textures/`, with animations | Built | | `blockstate` | `assets/*/blockstates/*.json` | `blocks/*.json` with `variants` or `parts`, string states made numeric | Built | | `item` | `assets/*/models/item/*.json` | `items/*.json` for items that aren't a block's, with their sprite | Built | | `lang` | `assets/*/lang/en_us.json` | item and block names | | | `recipe` | `data/*/recipe(s)/**.json` | `recipes/`: vanilla types to bworld's. Stonecutting so far | Built | | `tag` | `data/*/tags/**.json` | `tags/`, Forge's shared tags as `c:`, missing entries optional | Built | | `loot` | `data/*/loot_table(s)/**.json` | `drops`, or loot tables | | | `worldgen` | `data/*/worldgen/**.json` | `worldgen/`: ores, and features where bworld has them | | | `sound` | `assets/*/sounds.json`, `sounds/**.ogg` | sounds, once the engine has them (S8) | | | `mod` | all of the above | a whole mod folder with a manifest, and one report | | Block properties (shape, tool, toughness) aren't in any data file: Java mods set them in code. `mod` writes a block for each blockstate with placeholder properties, and a per-mod table fills them in. For Create that table is `mods/create/import/blocks.json`. **What `model` does today.** It keeps `parent`, since the engine merges parents in when it loads (see [Parents](docs/modding/resources/models.md#parents)), and remaps it like any id. Minecraft's template parents (`cube`, `cube_all`, `cube_column`, `orientable`, slabs, stairs, walls, glass panes) become the base game's models of the same name in `mods/bworld/models/templates/`, and the default remap is read from that folder. A parent that holds nothing bworld uses, like `block/block` or a mod's own root of display transforms, is left out. It drops Blockbench's extras and `display`, keeps every texture variable (some models draw faces with `#particle`), skips item sprites (`item/generated`) and `loader` models (OBJ, composite) anywhere up a model's parents, and says why. Run over Create 0.5.0.j's 2237 model files it converts 2105, and with its textures they make a mod `check-mods` accepts. The rest are 79 item sprites, 50 OBJ or composite models and 5 display-only roots, and 3 name clashes were fixed with one remap line. Merged the way the game merges them, the 2099 models with boxes come out identical to flattening them, and the files are 1.5 MB instead of 3.4 MB. 26 vanilla textures they use (pistons, redstone torches, rails) aren't in bworld yet. **What `texture` does today.** It copies PNGs keeping their folders, since bworld already names a texture in a subfolder by joining the folders with `_`, which is the same id the converted models use. A `.png.mcmeta` becomes the `.json` next to the png, keeping only its `animation` section: bworld reads the same format. It checks every texture against the limits a `.bmod` checks, skips Minecraft's own textures (the remap points at bworld's), and needs `--namespace` when a folder holds textures of more than one mod, since a texture's namespace comes from the mod it ends up in. For Create 0.5.0.j it copies 989 textures and 11 animations, and skips the six 512×512 title screen panoramas. Its textures and models together make a mod `check-mods` accepts, with warnings only for the 27 missing textures. **What `blockstate` and `item` do today.** `blockstate` writes a block for each blockstate: each property becomes a numbered state with the fewest bits that fit (booleans as false and true, facing as north, east, south, west, up and down so a 2 bit facing still faces its placer), properties that never change the look (like `waterlogged`) are left out, `variants` keep their models and `x` and `y` turns, and a `multipart` becomes `parts`, one for each way a part can be drawn. Blocks that aren't full cubes are `cutout`, or `translucent` when their model asks for it. A model that can't be imported (OBJ, composite) is drawn as a placeholder cube. Every block gets the same placeholder mining (a second, any tool) and drops itself, since Java mods set those in code. A block has an item when Java has an item model for it, drawn with that model, or flat as its sprite. `item` writes the items that aren't a block's, with their sprite; the 11 Java draws in 3D (wrench, goggles) are flat with a texture of their model until bworld items can have models. `mods/create` is the result: 556 blocks and 81 items from 0.5.0.j (the crimson and warped windows are left out with the remap file's `skip`) that can be placed and look like Create's, with no behavior. `check-mods` accepts it, warning only about 31 vanilla textures bworld doesn't have yet. `uvlock` is left out (132 blockstates use it), so some turned textures turn with their models where Java keeps them upright. **What `tag` and `recipe` do today.** Tags and recipes are checked against the mods next to `--output`, read the way `check-mods` reads them. `tag` writes each item, block, entity and biome tag in bworld's format, which is Java's, keeping folders in tag ids. An entry that doesn't exist here becomes optional (`required: false`), so the tag loads now and picks it up once it's added, and what the remaps skip is left out. `recipe` converts each type bworld has an equivalent for and reports the rest by type. A recipe naming an item or tag that doesn't exist here, or that only loads under a condition (another mod installed), is skipped, since bworld's recipes have to be complete. Only `minecraft:stonecutting` is converted so far, to `bworld:stonecutting`. Create 0.5.0.j's data gives 89 tags: 45 of Create's and 44 of Forge's shared ones, which are `c:` here. Fluid tags are skipped. Of its 531 stonecutting recipes, 423 are converted. The other 108 cut granite, diorite, deepslate, calcite, tuff and dripstone, which bworld doesn't have yet. Re-importing once it does brings them in. **For Create**, `mods/create/import/` keeps the remap file and the commands, and later the block table. Re-running the import is one command, and hand-written files are never in the folders it writes. **Vanilla ids in recipes.** Create's recipes use 447 distinct Minecraft ids, like dyes, `minecraft:cobblestone` and `minecraft:netherrack`. Each becomes the bworld id of the same name, or another with the remap file's `ids`. A recipe using one bworld doesn't have is skipped and listed in the report, so the report always says how much of Create is missing because bworld lacks something. ## Architecture How each of Create's shared pieces lands in bworld: | Create | bworld | | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SmartBlockEntity` and its `BlockEntityBehaviour`s | A block with several components. Each behaviour (filtering, scroll value, inventory, fluid tank, transported items) is one reusable `create:` component with params | | `lazyTick` (every N ticks) | A counter in the component, or `on_second` | | `sendData` / `getUpdateTag` | Client-visible tile data (R1) | | `BlockEntityRenderer` and Flywheel `Visual`s | Block visuals (R2) drawing instances (R3) | | `AllPartialModels` | Models in `models/` used by visuals, not blocks (R4) | | `AllInstanceTypes`: rotating, scrolling, scrolling transformed, fluid | Engine instance types (R3) | | `RotationPropagator`, `KineticNetwork` | `scripts/kinetics/` | | NeoForge capabilities (`IItemHandler`, `IFluidHandler`) | Block capabilities (S1, S2) | | `ProcessingRecipe` and its 19 types | Custom recipe types parsed in one place (`scripts/recipes/`) | | `AbstractContraptionEntity`, `Contraption` | Engine block structure entities (S6) and the mod's assembly code | | `AllPackets` | Mod channels | | Menus and screens | Menus and screens, which bworld has | | `AllConfigs` | `mods/create/config.json`, read in `setup` (S12) | | Registrate, datagen | The importer | | Mixins | Engine hooks, only where an engine feature isn't worth adding | | Ponder | A scene player (P13) | | `compat/jei` | Recipe viewer categories (R11) | Server code is laid out by subsystem, each a folder with no `ctx` in its core logic so tests can call it directly: ``` mods/create/scripts/ server.ts shared.ts client.ts worldgen.ts kinetics/ connections, spreading, stress, generators processing/ press, mixer, millstone, crushing, saw, fan, deployer, crafter, basin, burner, sequenced assembly logistics/ belts, funnels, tunnels, chutes, depots, arm, vaults, filters, packages fluids/ pipes, pumps, tanks, spouts, drains, hose pulley, boilers redstone/ links, nixie tubes, display links, diodes, observers contraptions/ assembly, movement, actors, controls trains/ track graph, signals, stations, schedules, train movement equipment/ wrench, goggles, potato cannon, backtank, toolbox, symmetry wand recipes/ parsing every Create recipe type visuals/ client visuals for each block that moves ``` ## Engine Work Everything here is general, and none of it mentions Create. Each line says which phase first needs it. ### Rendering **R1. Client-visible tile data** (P1). A component marks part of a block's tile data for clients, sent with the chunk and again when it changes. Like NeoForge's `getUpdateTag`, but per field, so a fast-changing field doesn't resend the rest. The display item (`set_block_item`, `ClientLevel.block_items`) moves onto it, so there's one way to sync block data. **R2. Block visuals** (P1). `ctx.render.register_visual(block_id, factory)` in client scripts. A visual is created when its chunk is meshed, updated when the block's client data or states change, and deleted with the block or chunk, like Flywheel's `Visual`. Most visuals only create instances and update them on change. A visual that has to animate on the CPU (a crank easing in, a press head) asks for a per-frame callback, like `DynamicVisual`. The engine keeps visuals per chunk and skips whole chunks outside the frustum. **R3. Instanced drawing** (P1). A WebGPU pipeline that draws one model many times from an instance buffer, the thing bworld has none of today (`client/renderer/core.ts` only batches vertices). The instance types, matching Create's: | Type | Per instance | Shader | | ------------- | ------------------------------------------ | ----------------------------------------------------------------------- | | `transformed` | a matrix, light, tint | moves the model | | `rotating` | position, axis, rpm, offset, light, tint | turns the model around its axis by `ticks × rpm × 0.3 + offset` degrees | | `scrolling` | position, rotation, uv scroll speed, light | scrolls the texture coordinates, for belts | | `fluid` | box, fluid texture, fill, light | a box of a fluid's texture, for tanks and pipes | Instances are grouped by model and type, and each group is one draw call. Light is packed per instance from the block's light, updated when that light changes. `rotating` is the important one: thousands of shafts at a steady speed cost nothing per frame. See `ports/sodium` for how to keep buffer updates cheap. **R4. Models without blocks** (P1). Any model in `models/` can be loaded by id for visuals, baked once into a GPU buffer, and turned for whatever axis it's used on. **R5. The model format** (P0). What Create's models use that bworld's don't support yet (`parent` and `x` turns are built): - `uvlock`; - element `rotation` at every 22.5° step on all three axes; - item models from model JSON (3D items in the hand and the GUI, with `display` transforms), since Create's wrench, goggles and potato cannon aren't flat sprites. **R6. Connected textures** (P2). Create's casings, windows and vaults pick a tile from a sheet depending on which neighbours are the same block (`foundation/block/connected/`: rectangle, horizontal, vertical and omni). It's done in the chunk mesher, from a `connected` field on a block's textures that names the sheet and the kind. Generic: any mod's glass can use it. **R7. Block structure rendering** (P7). A contraption's blocks are meshed once by the chunk worker, as a small chunk of their own, and drawn with the contraption's matrix each frame. Its moving parts (a drill on it, a bearing's shaft) are instances drawn relative to it. A block change on it remeshes only it. **R8. Render time** (P1). World ticks plus the partial tick, as a shader uniform and for client scripts. **R9. Particles** (P3). A simple GPU particle system: sprite, velocity, gravity, lifetime. Used for rotation indicators, crushing, fan processing, steam, fluid splashes. Optional for gameplay, so it can come late. **R10. In-world text and boxes** (P3). Create's value boxes (the number on a scroll value, filter slots on a block's side) and goggles' overlay. A small API for drawing a label or an item at a point in the world, and a HUD element API, which is in bworld's types but throws today. **R11. 3D in GUIs** (P3). Drawing a model or block in a screen, turned and animated, for the recipe viewer's Create categories (a press pressing over its recipe, like `compat/jei`), goggles and ponder. ### Server and Gameplay **S0. Ticking only what ticks** (P1, built). `ServerWorld` keeps the tiles that tick per chunk, so `GameServer.tick` only looks at the chunks near players instead of every tile in the world. A component turns ticking off and on for one block with `block.set_ticking(false)`, or `ctx.world.set_block_ticking(x, y, z, true)` from elsewhere, like returning no ticker in NeoForge, and it stays off through saving. A shaft has tile data and never ticks. A press only ticks while pressing. **S1. Block capabilities** (P3). `ctx.capabilities.register_block("items", block_id, (block, side) => handler)` and `ctx.world.capability("items", x, y, z, side)`, like NeoForge's `BlockCapability`. Handlers insert, extract, report slots, and simulate. Chests and furnaces get them in `mods/bworld`. Funnels, chutes, arms, deployers, belts and vaults all move items only through this. **S2. Fluids** (P5). A fluid registry (bworld's liquids are fluids, plus mods' own like Create's honey and chocolate), fluid stacks with amounts in millibuckets, a `"fluids"` capability, and fluid containers in items (buckets, bottles). **S3. Redstone** (P6, or earlier for clutches). A signal API in the engine (each block side has a power level 0 to 15, `get_signal`, `has_neighbor_signal`, updates to neighbours) and the basic blocks in `mods/bworld`: lever, button, dust, torch, repeater, comparator, lamp. Create reads and makes signals in about 40 blocks, and bworld has no redstone at all today. **S4. Machines acting on the world** (P3). - `liquid_flow(x, y, z)` (wraps `common/physics.ts`), for water wheels and fans. - Item entities in a box, which can be changed and removed, for the press, fans and belts picking items up. - Pushing entities, for fans. - Breaking a block over time with progress shown, and its drops, for drills and saws. - A fake player using an item on a block, for the deployer (`DeployerFakePlayer`). **S5. Scripted entities** (P7). Mods can define an entity's behaviour in server scripts (tick, data, interaction) and how it's drawn in client scripts. Needed for the contraption entity, seats, potato cannon projectiles, trains and packages. **S6. Block structure entities** (P7). An entity that carries a grid of blocks with their states and tile data, moved and turned as a whole: assembled from the world and put back, saved, and synced. Players and mobs stand on it and bump into it as it moves (Create's `ContraptionCollider`, about 1000 lines, is the hardest part), and they can point at and use its blocks. Generic: boats with decks, falling structures and elevators would all use it. **S7. Player API additions** (P1). `sneaking` on players, placements and interactions. Reach from an attribute, for the extendo grip. Item use events (use, release, using for some time) for the potato cannon and wands. **S8. Sound** (P3). Web Audio, positional, with sound events defined in data. bworld has no sound at all yet. Create's whistles, presses, cranks and trains want it, but nothing breaks without it. **S9. More recipe types in bworld** (P0). `shapeless` crafting (Create's cogwheels and many others), stonecutting (palettes have hundreds of stonecutting recipes, and the mechanical saw uses them), and smoking and blasting for fans. Stonecutting is built, as `bworld:stonecutting` with the stonecutter, and the saw reads the same recipes with `ctx.recipes.list("bworld:stonecutting")`. **S10. Block shape families in bworld** (P10). Stairs, slabs and walls don't exist in bworld yet, and Create's palettes are mostly those. They're components with placement rules in `mods/bworld`, like the fence and trapdoor. **S11. Layered ore features** (P2). Create's striated ores are bands of stone types, not blobs. A worldgen feature in `mods/create/scripts/worldgen.ts`, or a data feature if STRUCTURES.md's data features exist by then. Zinc is a plain ore in `ores.json`. **S12. Mod config** (P1). A mod's `config.json`, overridable per server, read in `setup`. Create's stress values, speed limits and processing times live there, and tests can set them. **S13. NBT** (P11). Reading and writing structure NBT, shared with STRUCTURES.md's `common/nbt.ts`, for schematics and ponder scenes. **S14. Uploading files** (P11). A client sending a file to the server in pieces over a mod channel, for schematics. ## Recipes All 19 of Create's types, plus the vanilla types its data uses: | Type | Count | Made by | Phase | | ----------------------------------------------------- | ----- | ------------------------------------------- | ----------------------- | | `crafting` (shaped/shapeless) | 369 | crafting grid | P0 | | `stonecutting` | 327 | stonecutter (S9), mechanical saw | P3 | | `smelting`, `blasting`, `smoking`, `campfire_cooking` | 64 | furnace, fans | P3 | | `pressing` | 43 | mechanical press | P3 | | `milling` | 246 | millstone | P3 | | `crushing` | 211 | crushing wheels | P3 | | `cutting` | 32 | mechanical saw | P3 | | `splashing`, `haunting` | 73 | encased fan through water or soul fire | P3 | | `deploying` | 167 | deployer | P3 | | `item_application` | 8 | using an item on a block | P3 | | `sandpaper_polishing` | 1 | sand paper | P3 | | `mixing`, `compacting` | 21 | mixer and press over a basin | P3 (items), P5 (fluids) | | `mechanical_crafting` | 4 | mechanical crafters | P3 | | `sequenced_assembly` | 3 | belts with presses, deployers, spouts, saws | P4 | | `filling`, `emptying` | 24 | spout, item drain | P5 | | `toolbox_dyeing`, `item_copying`, `conversion` | — | built-in, special | P9 | Create's own types stay in Create's format inside bworld's envelope: ```json { "format_version": 1, "recipe": { "type": "create:pressing", "ingredients": [{ "tag": "c:ingots/iron" }], "results": [{ "id": "create:iron_sheet" }] } } ``` `scripts/recipes/` parses all of them in one place: ingredients as `{ item }`, `{ tag }`, lists of those, or sized fluid ingredients; results as `{ id, count, chance }` or fluid stacks; `processing_time` and `heat_requirement`. It checks each type's input and output limits, which come from each recipe class's `getMaxInputCount` and `getMaxOutputCount`. The recipe viewer gets one reader for this shape, so every Create type shows with no per-type code, and animated categories (R11) are added per machine on top. ## Kinetics The core of everything, so its rules are written out here. **What turns.** One component, `create:kinetic`, with params for which state holds the axis (`axis`, `facing`, `horizontal_facing`), which ends have an axle, whether it's a small or large cog, and its stress impact. Generators add `create:generator` with a capacity. Special connections (gearbox, chain drive, belt, speed controller) are named handlers in `kinetics/connections.ts`. **Connections**, with the ratio speed is multiplied by on the way across: | Pair | Where | Ratio | | -------------------- | --------------------------------------------------------------------------------- | ------------------------ | | Axle to axle | Face neighbours along the axis, both with an axle toward each other | 1 | | Small cog, small cog | Face neighbours, same axis, not along it | −1 | | Large cog to small | Same axis, level along it, ±1 on both other axes | −2 (−0.5 the other way) | | Large cog, large cog | Different axes, ±1 along both their axes, 0 on the third | ±1 by the offsets' signs | | Gearbox | Turns each side, reversing by side, see `getAxisModifier` in `RotationPropagator` | ±1 | | Chain drive | Along a line of chain drives, with the adjustable one's ratio | per block | | Belt | Every segment of a belt turns with its two ends | 1 | A large cog also looks at the 12 blocks diagonal to it along an edge. Cog placement rules (no large cog face to face with any cog off its axis) and the axis a cog picks when placed are in `CogWheelBlock`. **Spreading.** When a kinetic block is placed or a generator's speed changes, its speed spreads to what it's connected to. If a neighbour already turns the other way, or the speed passes 256 rpm, the changed block breaks. A faster neighbour takes over this block, and a faster block takes over its neighbour's tree. In a loop, a speed that doesn't match breaks the block. Removing a block clears the tree it was the source of and spreads again from what's left powered at its edge. Both walks use a queue, not recursion. Rules from `RotationPropagator`. **Stress.** A network's capacity is the sum of each generator's capacity × |rpm|, and its stress the sum of each block's impact × |rpm|. When stress is more than capacity, every block in it acts still and is drawn still. The network is found by walking connections when something changes, never per tick. Values come from `BlockStressValues` and config defaults, into `config.json`. **What the client gets.** Each kinetic block's rpm and whether its network is overstressed, in client data (R1). Its visual makes a `rotating` instance with the axis, rpm and an offset that keeps cog teeth meshed. The offset is 22.5° when the block's coordinates on the two axes that aren't its axis add up to an even number, otherwise 11.25° for large cogs and 0 for the rest. A speed change updates one instance, and nothing else happens per frame. **Chunk borders.** Tile data keeps speeds across unloading. Create tracks unloaded members' stress separately (`KineticNetwork`'s unloaded stress). Do the same, so a network across an unloaded chunk counts right. ## Phases Each phase ends with every test passing and something to see and use in a world. Engine work (R and S) is listed where it's first needed. ### P0: Importer and Skeleton - S9 (`shapeless`), R5. - The importer's other kinds, up to `mod`, and Create's remap file and block table in `mods/create/import/`. - `mods/create` with every block and item imported, static models, names, recipes that only need crafting, tags. Check: every Create block can be placed and looks right standing still, crafting recipes work, and the report lists what's missing. ### P1: Kinetics - S0, S7, S12, R1, R2, R3 (`transformed` and `rotating`), R4, R8. - Shaft, cogwheel, large cogwheel, gearbox, vertical gearbox, encased shafts and cogs, clutch and gearshift (with a placeholder signal until S3), chain drive and adjustable chain gearshift, rotation speed controller, speedometer and stressometer. - Generators: hand crank, valve handle, water wheel, large water wheel, creative motor. - Kinetic network, stress and overstress. Check: a water wheel drives a long shaft line through gearboxes and cog ratios, all turning smoothly on the GPU, and 1000 shafts cost nothing per frame and only a little per tick. ### P2: Materials and World - S11, R6. - Zinc ore, striated stone bands, andesite alloy, brass (made in P3's mixer), casings with connected textures. Check: new worlds have zinc and Create's stones, and casings join up. ### P3: Processing - S1, S4, S8, R9, R10, R11, and smoking and blasting from S9. - Mechanical press, millstone, crushing wheels, mechanical saw, encased fan with its processing (washing, smoking, blasting, haunting from `AllFanProcessingTypes`), deployer, mechanical crafters, item application, sand paper, depot, basin, mixer and compacting (items only), blaze burner and its heat. - Recipe viewer: Create's recipe format, catalysts, and animated categories. Check: ores go through crushing, washing and smelting into more ingots than a furnace alone gives, and brass is mixed in a heated basin. ### P4: Logistics - R3's `scrolling` type. - Belts. A belt is a line of segments, and only its controller (its first segment) ticks, moving every item on it (`BeltInventory`), like `BeltBlockEntity.isController`. Items on belts are instances drawn by the controller's visual. - Funnels, brass and andesite tunnels, chutes and smart chutes, mechanical arm, item vaults (multiblock), filters and attribute filters, sequenced assembly on belts. Check: a sorting line with funnels, filters and an arm, and a precision mechanism made by sequenced assembly. ### P5: Fluids - S2, R3's `fluid` type. - Fluid pipes, encased and glass pipes, mechanical pump, fluid tanks (multiblock), spout, item drain, hose pulley, portable fluid interface, basins with fluids, mixing and compacting with fluids, filling and emptying. - Pipes are networks found by walking pipes from a pump when something changes (`FluidPropagator`, `FluidNetwork`). Fluid only moves while a pump runs, and a network with no running pump doesn't tick. - Steam engine and boilers on tanks (`BoilerData`), which are fluids plus heat plus kinetics. Check: a steam engine on a tank boiler, fed by a pump from water and heated by blaze burners, drives a factory. ### P6: Redstone - S3, in `mods/bworld` first. - Redstone link, nixie tube, display link and display board, threshold switch, smart observer, analog lever, pulse repeater, extender and timer, powered latch and toggle latch, contact, desk bell, sequenced gearshift. Clutch and gearshift switch to real signals. Check: a factory that stops when a vault is full and shows its count on a display board. ### P7: Contraptions - S5, S6, R7. - Mechanical bearing, windmill bearing with sails, clockwork bearing, mechanical piston, rope pulley, elevator pulley and contacts, gantry carriage, linear and radial chassis, super glue, contraption controls. - Actors, which act as their contraption moves (`AllMovementBehaviours`): drill, saw, harvester, plough, roller, deployer, seats, storage, portable interfaces. - Minecart contraptions need minecarts and rails, which bworld doesn't have. They wait until bworld has them, and the cart assembler with them. Check: a windmill turns, a drill on a piston mines a wall, and a player rides an elevator. ### P8: Trains - Train tracks and curved tracks, which are drawn as meshes made along their curves, not blocks. - The track graph (`TrackGraph`, `GlobalRailwayManager`), saved with the world, and train movement along it. - Bogeys, stations, assembly, signals and edge groups, schedules, train controls and HUD, train observers, displays. - A train is a block structure entity (S6) that follows the graph instead of moving freely. Check: a scheduled train runs between two stations through signals. ### P9: Equipment - Wrench (turning blocks, and picking them up with sneaking), goggles and the overlay (R10), extendo grip, potato cannon, symmetry wand, toolbox, copper backtank and diving gear (air under water), clipboard, blueprint, worldshaper, and Create's armor. ### P10: Decoration - S10. - Palettes (stone types in cut, polished, bricks, small bricks, layered and pillar, each as block, stairs, slab and wall), windows and panes (connected glass), girders and brackets, scaffolding, ladders, bars, doors, sliding and framed doors, placards, table cloths, copycats. - Copycats show another block's texture in their own shape, which needs a model built from tile data. They come last. ### P11: Schematics - S13, S14. - Schematic and quill, schematic table with uploads, schematicannon placing from a schematic with its fuel and materials. ### P12: Package Logistics (6.0) - Packager, repackager, frogport, chain conveyor, stock link and ticker, redstone requester, factory gauge, shop table cloths, cardboard. - All new art, see [Sources](#sources). ### P13: Ponder - A scene player: a small world from a scene's NBT, drawn in a screen (R11), with Create's scene scripts (`infrastructure/ponder/scenes/`) ported to run its steps. 0.5.0.j has 153 scene files. - The `W` key over an item opens its scenes. ## Tests `tests/create/`, a file per subsystem, with `test_game` from `tests/helpers.ts`. Each phase's check becomes tests: - **Rules from plain functions:** connection ratios, recipe parsing, belt item movement, pipe flow. - **Machines in a world:** an input goes in, the right output comes out, and nothing happens without power. - **Networks:** placing and breaking in the middle of a line; two generators fighting; overstress. - **Performance:** a tick with 10,000 shafts, and a frame's instance updates, stay under a budget. These are benchmarks (`deno bench`), not tests, so a slow machine doesn't fail CI. Following CLAUDE.md, tests check behaviour and not tuned numbers, except where the number is the point, like a 2:1 cog ratio. Recipes come from the imported data, so tests use Create's recipes instead of copying them. ## Open Questions - **Minecraft content Create assumes:** blazes (the blaze burner captures one), soul fire (haunting), the Nether and the End (crushing and haunting recipes), minecarts and rails (cart contraptions, controller rails), honey and chocolate as fluids, dyes. Add them to bworld, substitute them in Create's remap file, or drop what needs them? - **Unloaded chunks:** blocks only tick within 6 chunks of a player. Do factories need a way to stay loaded, like chunk loaders, or is "near a player" fine for bworld? - **Contraption collision:** port `ContraptionCollider`'s approach, or write a simpler one for bworld's physics (`common/physics.ts`) that handles turning structures differently? - **Trains before or after contraptions:** trains reuse S6, but they're also the most-loved part of Create. Is P8 worth moving earlier? - **6.0's package logistics:** new art for about 20 blocks. Port them, or leave Create at 0.5's logistics?