Skip to content

Wiring System

DarkBladeDev edited this page May 15, 2026 · 2 revisions

🔌 Wiring & Topology System

The Wiring System in MultiBlockEngine is a powerful, generic graph-based framework that allows connecting different blocks and machines through physical "cables" or logic links.

🧠 Core Concepts

1. Network Graph

A network is represented as a mathematical graph where:

  • Nodes: Individual blocks (machines, controllers, or cables).
  • Edges: Connections between these nodes.

The engine maintains these graphs in real-time, handling splits (when a cable is broken) and merges (when cables are connected) efficiently.

2. Network Types

MultiBlockEngine supports multiple isolated topologies. This prevents different systems from interfering with each other even if they share the same space:

  • ENERGY: For power distribution.
  • DATA: For signal and logic.
  • FLUID: For liquid transport.
  • ITEM: For item logistics.

3. Ports

Machines interact with networks through Ports. A port defines:

  • Direction: INPUT (accepts) or OUTPUT (emits).
  • Type: Which network type it belongs to.
  • Location: The specific block in the pattern that acts as the port.

🧱 YAML Configuration

You can define ports directly in your multiblock YAML:

id: simple_generator
version: "1.0.0"
controller: FURNACE

ports:
  energy_out:
    direction: output
    type: energy
    block: controller
    capabilities: [emit]

Port Block References

  • controller: The controller block itself.
  • [x, y, z]: An offset relative to the controller.
  • NORTH, SOUTH, etc.: Sugar for common offsets.

🛠️ Tooling

Wire Cutter & Wrench

  • Wire Cutter: Used to manually disconnect nodes or split networks.

💻 Developer API

To interact with the wiring system in Java:

@InjectService
private NetworkService networkService;

public void checkNetwork(Location loc) {
    Optional<NetworkNode> node = networkService.getNodeAt(loc);
    node.ifPresent(n -> {
        NetworkGraph graph = n.getGraph();
        // ...
    });
}

Clone this wiki locally