-
Notifications
You must be signed in to change notification settings - Fork 71
5.2 Tunnel Graph Structure
Ted Senft edited this page Jul 9, 2023
·
1 revision
Memory Graph Structure:
flowchart
TN(TunnelNode)
TTN(TunnelTypeNode)
CMN(CompactMachineNode)
TN -- TunnelTypeEdge --> TTN
TN -- TunnelMachineEdge --> CMN
- version: 3.1.0
-
nodes:
CompoundTag
-
node_count:
int
-
tunnels:
List<TunnelNode> | ListTag<CompoundTag>
-
tunnel_types:
List<TunnelTypeNode> | ListTag<CompoundTag>
-
machines:
List<CompactMachineNode> | ListTag<CompoundTag>
-
node_count:
-
edges:
CompoundTag
-
edge_count:
int
-
machines:
List<TunnelMachineEdge> | ListTag<CompoundTag>
-
tunnel_types:
List<TunnelTypeEdge> | ListTag<CompoundTag>
-
edge_count:
- Serialization is now moved to a dedicated class,
TunnelGraphNbtSerializer
. -
version
is now added to the file root, specifying 3.1.0. -
graph
has been flattened intonodes
andedges
. -
node_count
andedge_count
values have been added for validation. -
nodes
have been flattened and no longer use a registry codec.- Each node type now has a constant key for its group, available from
TunnelGraphNbtKeys
.
- Each node type now has a constant key for its group, available from
-
edges
have been flattened and no longer use a registry codec.- Similar to nodes, keys can be found in
TunnelGraphNbtKeys
.
- Similar to nodes, keys can be found in
- All nodes and edges, due to no longer requiring a registry codec, have had their
type
field removed.
The following is the general structure of a node:
field | type | description |
---|---|---|
id | UUID |
|
data | CompoundTag |
Node data, from encoding with the node's codec. |
field | type | value |
---|---|---|
pos | BlockPos |
field | type | value |
---|---|---|
tunnel_type | ResourceKey<TunnelDefinition> |
field | type | value |
---|---|---|
dimension | ResourceKey<Level> |
|
position | BlockPos |
In addition to the edge data, stored in data
as a CompoundTag
, the following is stored for every edge:
field | type | description |
---|---|---|
from | UUID |
The UUID of the edge origin node. (U) |
to | UUID |
The UUID of the edge target node. (V) |
data | CompoundTag |
Edge data, from encoding with the edge's codec. |
field | type | value |
---|---|---|
side | Direction |
(No data stored for this edge type)