From ac135d190746de5bb02a076e456629d1a7b6bb43 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sat, 1 Feb 2025 05:39:01 +1000 Subject: [PATCH] More logging system use --- .../cortex/voxy/commonImpl/importers/WorldImporter.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java index 0dfb7496..45c143ea 100644 --- a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java +++ b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java @@ -149,7 +149,7 @@ public class WorldImporter { var name = file.getName(); var sections = name.split("\\."); if (sections.length != 4 || (!sections[0].equals("r")) || (!sections[3].equals("mca"))) { - System.err.println("Unknown file: " + name); + Logger.error("Unknown file: " + name); continue; } int rx = Integer.parseInt(sections[1]); @@ -198,7 +198,7 @@ public class WorldImporter { var fileData = new MemoryBuffer(fileStream.size()); if (fileStream.read(fileData.asByteBuffer(), 0) < 8192) { fileData.free(); - System.err.println("Header of region file invalid"); + Logger.warn("Header of region file invalid"); return; } this.importRegionFile(fileData, x, z); @@ -297,7 +297,7 @@ public class WorldImporter { private DataInputStream decompress(byte flags, InputStream stream) throws IOException { ChunkCompressionFormat chunkStreamVersion = ChunkCompressionFormat.get(flags); if (chunkStreamVersion == null) { - System.err.println("Chunk has invalid chunk stream version"); + Logger.error("Chunk has invalid chunk stream version"); return null; } else { return new DataInputStream(chunkStreamVersion.wrap(stream)); @@ -330,8 +330,7 @@ public class WorldImporter { this.importSectionNBT(x, y, z, section); } } catch (Exception e) { - System.err.println("Exception importing world chunk:"); - e.printStackTrace(); + Logger.error("Exception importing world chunk:",e); } this.updateCallback.update(this.chunksProcessed.incrementAndGet(), this.estimatedTotalChunks.get());