Skip to content

Commit 1dce0c3

Browse files
committed
忘了在节点反序列化之后将网络设置回去...
1 parent 5c30df6 commit 1dce0c3

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/java/com/circulation/circulation_networks/manager/NetworkManager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,6 @@ public void initGrid() {
416416

417417
var nbts = new ConcurrentLinkedQueue<NBTTagCompound>();
418418

419-
@Desugar
420-
record GridEntry(int dimId, Grid grid) {}
421-
422419
var entries = new ConcurrentLinkedQueue<GridEntry>();
423420
Arrays.stream(files).parallel().forEach(file -> {
424421
try {
@@ -427,6 +424,7 @@ record GridEntry(int dimId, Grid grid) {}
427424
int dimId = nbt.getInteger("dim");
428425
if (!DimensionManager.isDimensionRegistered(dimId)) return;
429426
var grid = Grid.deserialize(nbt);
427+
if (grid == null) return;
430428
entries.add(new GridEntry(dimId, grid));
431429
} catch (IOException ignored) {
432430
}
@@ -451,4 +449,8 @@ record GridEntry(int dimId, Grid grid) {}
451449
}
452450
nextGridId = maxId + 1;
453451
}
452+
453+
@Desugar
454+
private record GridEntry(int dimId, IGrid grid) {
455+
}
454456
}

src/main/java/com/circulation/circulation_networks/network/Grid.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static Grid deserialize(NBTTagCompound nbt) {
3737
var nodeNbt = (NBTTagCompound) nbtBase;
3838
var node = RegistryNodes.deserialize(nodeNbt);
3939
if (node != null) {
40+
node.setGrid(grid);
4041
node.setActive(true);
4142
grid.nodes.add(node);
4243
posMap.put(nodeNbt.getLong("pos"), node);

0 commit comments

Comments
 (0)