Repository navigation
Codex Logic Foreign Machines
The Factory Controller can also run machines of other mods. For that, a mod or an add-on tells QNet what such a machine can make; a Machine Interface in front of the machine then fills it and empties it like a QNet machine.
- Install the mod or add-on that describes the machine to QNet (QNet itself describes no foreign machines).
- Put a Machine Interface against the machine and link it to the Storage Controller of the factory.
- The machine appears in the Machines tab of the Factory Controller with tier 1, and its products in the list of things to make.
The interface uses the machine's normal inventories, the same ones pipes use. Nothing else of the machine is touched: its own energy, settings and upgrades stay its business.
Warning
Only products may be taken The interface takes everything the machine lets pipes take out. If the machine lets pipes take its inputs too, the interface takes them back out at once. Such a machine does not work with the factory.
QNet's public API has the interface ProductionCapabilityProvider (package dev.cptgummiball.qnet.api.automation). A provider answers, for a block id, what that machine can make:
- Register it once while your mod starts, with
QNetApi.automation().register(provider). After start-up the API is closed. -
capabilities(blockId)returns a list ofProductionCapability, or an empty list for blocks the provider does not know. For one block id the first provider with an answer wins. The answer is asked once per block id after every data reload and kept, so it may depend on recipes but not on one block's state. - A
ProductionCapabilityhas an id (namespaced, unique for that block), the inputs of one run (at least one), the outputs of one run (at least one) and the time of one run in ticks (at least 1; it is only shown). - A
ProductionStackis an item, fluid or gas with an id and an amount (items in pieces, fluids and gases in mB). Inputs may name a tag as#namespace:path; outputs may not. - Only list outputs that come for sure. The planner never counts on chance outputs; the interface takes them anyway.
- Optionally
busy(dimension, pos, blockId)tells whether the machine at a position is working. The controller then waits for its outputs as long as it works; without it, it calls a job done 200 ticks after the last delivery or product.
QNet blocks are never asked; a provider that throws an error counts as not knowing the block (logged once).
Every capability becomes a recipe of the machine's own kind, qnet_foreign:<namespace>/<block>, at tier 1 and without energy. The planner treats the machine like a QNet machine that knows only these recipes. If a QNet recipe makes the same item, the QNet recipe comes first.
Tip
Example The example add-on in the QNet sources registers a test press that presses one shard into two dusts. Look at it when you write your own provider.
QNet Codex
Getting Started
- Welcome to QNet
- The First Machines
- Tiers and Components
- Energy, Fluids and Gases
- Building Plants
- The Quanta Linker
- Teams and Rights
- Upgrades and Plant Modules
Energy
- Energy Overview
- Basic Dynamo
- Thermoelectric Generator
- Stirling Generator
- Geothermal Heat Exchanger
- Solar Array
- Wind Turbine
- Solar Thermal Field
- Industrial Boiler
- Steam Turbine
- Gasifier
- Natural Gas and the Gas Derrick
- Gas Engine
- Gas Turbine
- Fission Reactor
- Nuclear Fuel Cycle
- Advanced Reactor Model
- Centrifuge Cascade
- Tokamak
- Little Star
- Micro Black Hole Plant
- Hawking Reactor
- Capacitor Bank
- Battery Hall
- Molten-Salt Store
- Gravity Store
- SMES
- Dimensional Store
- Process Heat
- Electric Heater and Heat Exchanger
- Incidents and Safety
- Radiation
Processing
- Crusher
- Induction Furnace
- Metal Former
- Assembler
- Plant Processor
- Farming Station
- Tree Harvester
- Electrolyzer
- Air Separator
- Chemical Reactor
- Industrial Centrifuge
- Crystallizer
- Tunnel Furnace
- Foundry
- Chemical Plant
- Assembly Complex
- Agricultural Facility
- Particle Facility
- Quantum Facility
- Matter Reconstructor
- Deep Core Extractor
- Plant Speed Modules
- Materials and Recipes
Rift
- The Rift
- Building the Complex
- Structure Parts
- Rift Gate Assembly
- Power Injection Array
- Stabilization Tower
- Coordinate Computation Array
- Dimensional Observatory
- Extraction Array
- Matter Receiving Facility
- Linking the Complex
- Running the Rift
- The Rift Console
- Research and Signals
- The Research Tree
- Mining
- Sectors and Diminishing Returns
- The Job Program
- Rift Map Table
- Command Terminal and Monitors
- Rift Materials
Storage
- The Storage Network
- Storage Controller
- Storage Units
- Storage Access Terminal
- Storage Interface
- External Storage Interface
- Bulk Tank
- Warehouse
- Linking Storage
Logic
Reference
Items and Blocks
- Advanced Circuit
- Ash
- Basic Circuit
- Bio Fertilizer
- Biomass
- Block Die
- Block Mold
- Casting Basin
- Charged Quantum Crystal
- Coal Dust
- Conductive Alloy Ingot
- Conveyor
- Copper Coil
- Copper Dust
- Copper Plate
- Copper Wire
- Creative Battery
- Creative Gas Tank
- Deepslate Lead Ore
- Deepslate Lithium Ore
- Deepslate Uranium Ore
- Efficiency Upgrade
- Emergency Vent
- Energy Cell
- Energy Transformer
- Exotic Matter
- Field Emitter
- Field Stabilizer
- Fluid Tank
- Gas Compressor
- Gas Tank
- Gear Die
- Gear Mold
- Generator Coil
- Gold Dust
- Gold Plate
- Heat Exchanger Tubes
- Induction Coil
- Industrial Frame
- Ingot Mold
- Iron Dust
- Iron Plate
- Irradiated Residue
- Laser Optic
- Block of Lead
- Lead Ingot
- Lead Ore
- Lithium Carbonate
- Lithium Dust
- Lithium Ore
- Machine Frame
- Nugget Mold
- Parallel Upgrade
- Pattern Card
- Plant Fiber
- Plate Die
- Plate Mold
- Polymer Sheet
- Precision Alloy Ingot
- Precision Frame
- Pump
- Quanta Linker
- Quantum Crystal
- Quantum Frame
- Quantum Processor
- Range Upgrade
- Raw Lead
- Raw Lithium
- Raw Uranium
- Refractory Bricks
- Rod Die
- Rod Mold
- Rotor Blade
- Rotor Shaft
- Sensor Module
- Servo Motor
- Silicon
- Silicon Boule
- Silicon Wafer
- Solidified Melt
- Speed Upgrade
- Stabilized Matter
- Steel Blend
- Steel Dust
- Steel Gear
- Steel Ingot
- Steel Plate
- Steel Rod
- Superconductor Wire
- Uranium Dust
- Uranium Ore
- Wire Die
- Yield Upgrade