From 7ccca030234627d065a89e21f14ed7bc82a1bd05 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Wed, 29 Oct 2025 02:09:22 +0800 Subject: [PATCH] try to fix BBOR protocol --- .../org/leavesmc/leaves/protocol/BBORProtocol.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java index f9e268e..5aba3f1 100644 --- a/lophine-server/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java +++ b/lophine-server/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java @@ -125,22 +125,24 @@ public class BBORProtocol implements LeavesProtocol { Map> cache = getOrCreateCache(dimensionID); for (var entry : structures.entrySet()) { StructureStart structureStart = entry.getValue(); - if (structureStart == null) { - return; + if (structureStart == null || !structureStart.isValid()) { + continue; } String type = "structure:" + entry.getKey(); BoundingBox bb = structureStart.getBoundingBox(); BBoundingBox boundingBox = buildStructure(bb, type); if (cache.containsKey(boundingBox)) { - return; + continue; } Set structureBoundingBoxes = new HashSet<>(); - for (StructurePiece structureComponent : structureStart.getPieces()) { - structureBoundingBoxes.add(buildStructure(structureComponent.getBoundingBox(), type)); + if (!structureStart.getPieces().isEmpty()) { + for (StructurePiece structureComponent : structureStart.getPieces()) { + structureBoundingBoxes.add(buildStructure(structureComponent.getBoundingBox(), type)); + } + cache.put(boundingBox, structureBoundingBoxes); } - cache.put(boundingBox, structureBoundingBoxes); } }