Skip to content

Commit

Permalink
change: hide BE mismatch warning behind flag
Browse files Browse the repository at this point in the history
Resolves #266
  • Loading branch information
ishland committed Feb 5, 2024
1 parent a43e637 commit f02b51a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

public class AsyncSerializationManager {

public static final boolean DEBUG = Boolean.getBoolean("c2me.chunkio.debug");

private static final Logger LOGGER = LoggerFactory.getLogger("C2ME Async Serialization Manager");

private static final ThreadLocal<ArrayDeque<Scope>> scopeHolder = ThreadLocal.withInitial(ArrayDeque::new);
Expand Down Expand Up @@ -80,7 +82,9 @@ public Scope(Chunk chunk, ServerWorld world) {
final HashSet<BlockPos> blockPos = new HashSet<>(this.blockEntities.keySet());
blockPos.addAll(this.pendingBlockEntityNbtsPacked.keySet());
if (this.blockEntityPositions.size() != blockPos.size()) {
LOGGER.warn("Block entities size mismatch! expected {} but got {}", this.blockEntityPositions.size(), blockPos.size());
if (DEBUG) {
LOGGER.warn("Block entities size mismatch! expected {} but got {}", this.blockEntityPositions.size(), blockPos.size());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static NbtCompound onChunkGetPackedBlockEntityNbt(Chunk chunk, BlockPos
} else {
final NbtCompound nbtCompound = scope.pendingBlockEntityNbtsPacked.get(pos);
if (nbtCompound != null && chunk instanceof WorldChunk) nbtCompound.putBoolean("keepPacked", true);
if (nbtCompound == null) LOGGER.warn("Block Entity at {} for block {} doesn't exist", pos, chunk.getBlockState(pos).getBlock());
if (nbtCompound == null && AsyncSerializationManager.DEBUG) LOGGER.warn("Block Entity at {} for block {} doesn't exist", pos, chunk.getBlockState(pos).getBlock());
return nbtCompound;
}
}
Expand Down

0 comments on commit f02b51a

Please sign in to comment.