diff --git a/src/main/java/me/cortex/voxy/client/core/gl/shader/Shader.java b/src/main/java/me/cortex/voxy/client/core/gl/shader/Shader.java index 3d117f25..4d606615 100644 --- a/src/main/java/me/cortex/voxy/client/core/gl/shader/Shader.java +++ b/src/main/java/me/cortex/voxy/client/core/gl/shader/Shader.java @@ -175,7 +175,7 @@ public class Shader extends TrackedObject { String log = GL20C.glGetShaderInfoLog(shader); if (!log.isEmpty()) { - System.err.println(log); + Logger.warn(log); } int result = GL20C.glGetShaderi(shader, GL20C.GL_COMPILE_STATUS); diff --git a/src/main/java/me/cortex/voxy/client/core/model/ModelFactory.java b/src/main/java/me/cortex/voxy/client/core/model/ModelFactory.java index 5f6c0150..5e9bbb55 100644 --- a/src/main/java/me/cortex/voxy/client/core/model/ModelFactory.java +++ b/src/main/java/me/cortex/voxy/client/core/model/ModelFactory.java @@ -8,6 +8,7 @@ import me.cortex.voxy.client.core.gl.Capabilities; import me.cortex.voxy.client.core.model.bakery.ModelTextureBakery; import me.cortex.voxy.client.core.rendering.util.RawDownloadStream; import me.cortex.voxy.client.core.rendering.util.UploadStream; +import me.cortex.voxy.common.Logger; import me.cortex.voxy.common.util.MemoryBuffer; import me.cortex.voxy.common.world.other.Mapper; import net.minecraft.block.Block; @@ -490,7 +491,7 @@ public class ModelFactory { throw new IllegalStateException("Biome was put in an id that was not null"); } if (oldBiome == biome) { - System.err.println("Biome added was a duplicate"); + Logger.error("Biome added was a duplicate"); } int i = 0; diff --git a/src/main/java/me/cortex/voxy/common/config/storage/other/FragmentedStorageBackendAdaptor.java b/src/main/java/me/cortex/voxy/common/config/storage/other/FragmentedStorageBackendAdaptor.java index 8f6a62e5..652d0aae 100644 --- a/src/main/java/me/cortex/voxy/common/config/storage/other/FragmentedStorageBackendAdaptor.java +++ b/src/main/java/me/cortex/voxy/common/config/storage/other/FragmentedStorageBackendAdaptor.java @@ -3,6 +3,7 @@ package me.cortex.voxy.common.config.storage.other; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import me.cortex.voxy.common.Logger; import me.cortex.voxy.common.config.storage.StorageBackend; import me.cortex.voxy.common.config.ConfigBuildCtx; import me.cortex.voxy.common.config.storage.StorageConfig; @@ -100,7 +101,7 @@ public class FragmentedStorageBackendAdaptor extends StorageBackend { } if (verification.size() != 1) { - System.err.println("Error id mapping not matching across all fragments, attempting to recover"); + Logger.error("Error id mapping not matching across all fragments, attempting to recover"); Object2IntMap.Entry> maxEntry = null; for (var entry : verification.object2IntEntrySet()) { if (maxEntry == null) { maxEntry = entry; } diff --git a/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java b/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java index 06e1d4dd..6f6deca0 100644 --- a/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java +++ b/src/main/java/me/cortex/voxy/common/thread/ServiceThreadPool.java @@ -274,8 +274,7 @@ public class ServiceThreadPool { } private void handleUncaughtException(Thread thread, Throwable throwable) { - System.err.println("Service worker thread has exploded unexpectedly! this is really not good very very bad."); - throwable.printStackTrace(); + Logger.error("Service worker thread has exploded unexpectedly! this is really not good very very bad.", throwable); } public void shutdown() { diff --git a/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java b/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java index ee51f984..fedca7c9 100644 --- a/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java +++ b/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java @@ -2,6 +2,7 @@ package me.cortex.voxy.common.world; import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +import me.cortex.voxy.common.Logger; import me.cortex.voxy.common.util.VolatileHolder; import me.cortex.voxy.common.world.other.Mapper; import org.jetbrains.annotations.Nullable; @@ -115,7 +116,7 @@ public class ActiveSectionTracker { if (status < 0) { //TODO: Instead if throwing an exception do something better, like attempting to regen //throw new IllegalStateException("Unable to load section: "); - System.err.println("Unable to load section " + section.key + " setting to air"); + Logger.error("Unable to load section " + section.key + " setting to air"); status = 1; } diff --git a/src/main/java/me/cortex/voxy/common/world/SaveLoadSystem.java b/src/main/java/me/cortex/voxy/common/world/SaveLoadSystem.java index 9a17263d..0e2cdfc9 100644 --- a/src/main/java/me/cortex/voxy/common/world/SaveLoadSystem.java +++ b/src/main/java/me/cortex/voxy/common/world/SaveLoadSystem.java @@ -1,6 +1,7 @@ package me.cortex.voxy.common.world; import it.unimi.dsi.fastutil.longs.Long2ShortOpenHashMap; +import me.cortex.voxy.common.Logger; import me.cortex.voxy.common.util.MemoryBuffer; import me.cortex.voxy.common.util.UnsafeUtil; import me.cortex.voxy.common.world.other.Mapper; @@ -120,7 +121,7 @@ public class SaveLoadSystem { if (section.key != key) { //throw new IllegalStateException("Decompressed section not the same as requested. got: " + key + " expected: " + section.key); - System.err.println("Decompressed section not the same as requested. got: " + key + " expected: " + section.key); + Logger.error("Decompressed section not the same as requested. got: " + key + " expected: " + section.key); return false; } @@ -145,7 +146,7 @@ public class SaveLoadSystem { long expectedHash = MemoryUtil.memGetLong(ptr); ptr += 8; if (VERIFY_MEMORY_ACCESS && data.size<(ptr-data.address)) throw new IllegalStateException("Memory access OOB"); if (expectedHash != hash) { //throw new IllegalStateException("Hash mismatch got: " + hash + " expected: " + expectedHash); - System.err.println("Hash mismatch got: " + hash + " expected: " + expectedHash + " removing region"); + Logger.error("Hash mismatch got: " + hash + " expected: " + expectedHash + " removing region"); return false; } } diff --git a/src/main/java/me/cortex/voxy/common/world/other/Mapper.java b/src/main/java/me/cortex/voxy/common/world/other/Mapper.java index 27045363..099d73b2 100644 --- a/src/main/java/me/cortex/voxy/common/world/other/Mapper.java +++ b/src/main/java/me/cortex/voxy/common/world/other/Mapper.java @@ -1,6 +1,7 @@ package me.cortex.voxy.common.world.other; import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import me.cortex.voxy.common.Logger; import me.cortex.voxy.common.config.IMappingStorage; import me.cortex.voxy.common.config.section.SectionStorage; import net.minecraft.block.Block; @@ -99,7 +100,7 @@ public class Mapper { if (entryType == BLOCK_STATE_TYPE) { var sentry = StateEntry.deserialize(id, entry.getValue()); if (sentry.state.isAir()) { - System.err.println("Deserialization was air, removed block"); + Logger.error("Deserialization was air, removed block"); sentryErrors.add(new Pair<>(entry.getValue(), id)); continue; } diff --git a/src/main/java/me/cortex/voxy/common/world/service/SectionSavingService.java b/src/main/java/me/cortex/voxy/common/world/service/SectionSavingService.java index 49c4733f..3467761d 100644 --- a/src/main/java/me/cortex/voxy/common/world/service/SectionSavingService.java +++ b/src/main/java/me/cortex/voxy/common/world/service/SectionSavingService.java @@ -69,7 +69,7 @@ public class SectionSavingService { public void shutdown() { if (this.threads.getJobCount() != 0) { - System.err.println("Voxy section saving still in progress, estimated " + this.threads.getJobCount() + " sections remaining."); + Logger.error("Voxy section saving still in progress, estimated " + this.threads.getJobCount() + " sections remaining."); while (this.threads.getJobCount() != 0) { Thread.onSpinWait(); } 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 e1e7e839..2cb1c694 100644 --- a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java +++ b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java @@ -327,7 +327,7 @@ public class WorldImporter implements IDataImporter { //TODO: create memory copy for each section if (regionFile.size < ((sectorCount-1) + sectorStart) * 4096L) { - System.err.println("Cannot access chunk sector as it goes out of bounds. start bytes: " + (sectorStart*4096) + " sector count: " + sectorCount + " fileSize: " + regionFile.size); + Logger.warn("Cannot access chunk sector as it goes out of bounds. start bytes: " + (sectorStart*4096) + " sector count: " + sectorCount + " fileSize: " + regionFile.size); continue; } @@ -341,7 +341,7 @@ public class WorldImporter implements IDataImporter { } else { int n = m - 1; if (regionFile.size < (n + sectorStart*4096L)) { - System.err.println("Chunk stream to small"); + Logger.warn("Chunk stream to small"); } else if ((b & 128) != 0) { if (n != 0) { Logger.error("Chunk has both internal and external streams");