From 5f1180a5ddd834598c2f3abb3013b3082e540dd9 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 14 Dec 2024 12:21:39 -0600 Subject: [PATCH] Revert "Fix holes when using Chunky" --- .../common/AbstractModInitializer.java | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/AbstractModInitializer.java b/common/src/main/java/com/seibel/distanthorizons/common/AbstractModInitializer.java index 4ec8fbd0f..3e6b4bf9c 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/AbstractModInitializer.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/AbstractModInitializer.java @@ -234,37 +234,36 @@ public abstract class AbstractModInitializer LOGGER.warn(startingString + "[WWOO] "+ wwooWarning); } - - // if chunky is active we need to run chunk update synchronously to prevent holes if DH gets overwhelmed - SharedApi.runChunkUpdatesAsync = !modChecker.isModLoaded("chunky"); - if (SharedApi.runChunkUpdatesAsync) + // Chunky + boolean chunkyPresent = false; + try { - LOGGER.info("Chunky detected. DH will run chunk updates on the server thread. This will prevent data loss or holes but may cause stuttering."); + Class.forName("org.popcraft.chunky.api.ChunkyAPI"); + chunkyPresent = true; } + catch (ClassNotFoundException ignore) { } - //// Chunky - //boolean chunkyPresent = modChecker.isModLoaded("chunky"); - //if (chunkyPresent) - //{ - // // Chunky can generate chunks faster than DH can process them, - // // causing holes in the LODs. - // // Generally it's better and faster to use DH's world generator. - // - // String chunkyWarning = "Chunky can cause DH LODs to have holes " + - // "since Chunky can generate chunks faster than DH can process them. \n" + - // "Using DH's distant generator instead of chunky or increasing DH's CPU thread count can resolve the issue."; - // - // if (showChatWarnings) - // { - // String message = - // // orange text - // "\u00A76" + "Distant Horizons: Chunky detected." + "\u00A7r\n" + - // chunkyWarning; - // ClientApi.INSTANCE.showChatMessageNextFrame(message); - // } - // - // LOGGER.warn(startingString + "[Chunky] "+ chunkyWarning); - //} + if (chunkyPresent) + { + // Chunky can generate chunks faster than DH can process them, + // causing holes in the LODs. + // Generally it's better and faster to use DH's world generator. + + String chunkyWarning = "Chunky can cause DH LODs to have holes " + + "since Chunky can generate chunks faster than DH can process them. \n" + + "Using DH's distant generator instead of chunky or increasing DH's CPU thread count can resolve the issue."; + + if (showChatWarnings) + { + String message = + // orange text + "\u00A76" + "Distant Horizons: Chunky detected." + "\u00A7r\n" + + chunkyWarning; + ClientApi.INSTANCE.showChatMessageNextFrame(message); + } + + LOGGER.warn(startingString + "[Chunky] "+ chunkyWarning); + } }