-
Notifications
You must be signed in to change notification settings - Fork 0
Wiring System
DarkBladeDev edited this page May 15, 2026
·
2 revisions
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.
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.
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.
Machines interact with networks through Ports. A port defines:
-
Direction:
INPUT(accepts) orOUTPUT(emits). - Type: Which network type it belongs to.
- Location: The specific block in the pattern that acts as the port.
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]-
controller: The controller block itself. -
[x, y, z]: An offset relative to the controller. -
NORTH,SOUTH, etc.: Sugar for common offsets.
- Wire Cutter: Used to manually disconnect nodes or split networks.
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();
// ...
});
}