From 72c9de354e0cd716a0910c714927bd344bfefa87 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 7 Jun 2023 22:59:49 -0500 Subject: [PATCH] Overhaul the config and start adding summary options also: - add DH vs MC lighting engine option - add a toggle for wireframe rendering --- .../common/wrappers/chunk/ChunkWrapper.java | 25 +++++-- .../common/wrappers/gui/ClassicConfigGUI.java | 3 +- .../wrappers/gui/updater/UpdateModScreen.java | 4 +- .../BatchGenerationEnvironment.java | 37 +++++----- .../worldGeneration/GenerationEvent.java | 2 - .../mimicObject/LightedWorldGenRegion.java | 67 ++++--------------- coreSubProjects | 2 +- .../com/seibel/lod/fabric/FabricMain.java | 2 +- .../mixins/client/MixinFogRenderer.java | 2 +- .../mixins/client/MixinLevelRenderer.java | 3 +- .../fabric/mixins/client/MixinMinecraft.java | 18 +++-- .../mixins/client/MixinTextureUtil.java | 2 +- .../forge/mixins/client/MixinFogRenderer.java | 2 +- .../mixins/client/MixinLevelRenderer.java | 4 +- .../forge/mixins/client/MixinMinecraft.java | 7 +- .../forge/mixins/client/MixinTextureUtil.java | 5 +- 16 files changed, 86 insertions(+), 99 deletions(-) diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/lod/common/wrappers/chunk/ChunkWrapper.java index 2ce56a2d5..27b3882e0 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/chunk/ChunkWrapper.java @@ -19,7 +19,9 @@ package com.seibel.lod.common.wrappers.chunk; +import com.seibel.lod.api.enums.config.ELightGenerationMode; import com.seibel.lod.common.wrappers.block.BlockStateWrapper; +import com.seibel.lod.core.config.Config; import com.seibel.lod.core.pos.DhBlockPos; import com.seibel.lod.core.pos.DhChunkPos; import com.seibel.lod.core.pos.Pos2D; @@ -56,6 +58,9 @@ public class ChunkWrapper implements IChunkWrapper private final LevelReader lightSource; private final ILevelWrapper wrappedLevel; + private final boolean useMcLightingEngine; + private final boolean isDhGeneratedChunk; + private final HashMap blockStateByBlockPosCache = new HashMap<>(); @@ -66,6 +71,10 @@ public class ChunkWrapper implements IChunkWrapper this.lightSource = lightSource; this.wrappedLevel = wrappedLevel; this.chunkPos = new DhChunkPos(chunk.getPos().x, chunk.getPos().z); + + this.useMcLightingEngine = (Config.Client.Advanced.WorldGenerator.lightingEngine.get() == ELightGenerationMode.MINECRAFT); + // TODO is this the best way to differentiate between when we are generating chunks and when MC gave us a chunk? + this.isDhGeneratedChunk = (this.lightSource.getClass() == LightedWorldGenRegion.class); } @@ -164,18 +173,19 @@ public class ChunkWrapper implements IChunkWrapper @Override public int getBlockLight(int x, int y, int z) { - // TODO is this the best way to differentiate between when we are generating chunks and when MC gave us a chunk? - if (this.lightSource.getClass() != LightedWorldGenRegion.class) + // use the full lighting engine when the chunks are within render distance or the config requests it + if (this.useMcLightingEngine || !this.isDhGeneratedChunk) { + // FIXME this returns 0 if the chunks unload + // MC lighting method - // (used when the chunks are within render distance) return this.lightSource.getBrightness(LightLayer.BLOCK, new BlockPos(x+this.getMinX(), y, z+this.getMinZ())); } else { // DH lighting method return this.getMaxBlockLightAtBlockPos(new DhBlockPos(x, y, z)); - } + } } /** * Note: this doesn't take into account blocks outside this chunk's borders
@@ -230,11 +240,12 @@ public class ChunkWrapper implements IChunkWrapper @Override public int getSkyLight(int x, int y, int z) { - // TODO is this the best way to differentiate between when we are generating chunks and when MC gave us a chunk? - if (this.lightSource.getClass() != LightedWorldGenRegion.class) + // use the full lighting engine when the chunks are within render distance or the config requests it + if (this.useMcLightingEngine || !this.isDhGeneratedChunk) { + // FIXME this returns 0 if the chunks unload + // MC lighting method - // (used when the chunks are within render distance) return this.lightSource.getBrightness(LightLayer.SKY, new BlockPos(x+this.getMinX(), y, z+this.getMinZ())); } else diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/gui/ClassicConfigGUI.java b/common/src/main/java/com/seibel/lod/common/wrappers/gui/ClassicConfigGUI.java index ea4e23700..a21c00c8a 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/gui/ClassicConfigGUI.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/gui/ClassicConfigGUI.java @@ -219,7 +219,8 @@ public class ClassicConfigGUI { ConfigBase.INSTANCE.configFileINSTANCE.loadFromFile(); // Changelog button - if (Config.Client.AutoUpdater.enableAutoUpdater.get()) { + if (Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get()) + { this.addBtn(new TexturedButtonWidget( // Where the button is on the screen this.width - 28, this.height - 28, diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/gui/updater/UpdateModScreen.java b/common/src/main/java/com/seibel/lod/common/wrappers/gui/updater/UpdateModScreen.java index 3d8b05483..011ddbfe8 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/gui/updater/UpdateModScreen.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/gui/updater/UpdateModScreen.java @@ -94,7 +94,7 @@ public class UpdateModScreen extends Screen { ); this.addBtn( // Silent update new Button(this.width / 2 - 75, this.height / 2 + 30, 150, 20, translate(ModInfo.ID + ".updater.silent"), (btn) -> { - Config.Client.AutoUpdater.promptForUpdate.set(false); + Config.Client.Advanced.AutoUpdater.automaticallyUpdate.set(true); SelfUpdater.updateMod(); this.onClose(); }) @@ -106,7 +106,7 @@ public class UpdateModScreen extends Screen { ); this.addBtn( // Never new Button(this.width / 2 - 102, this.height / 2 + 70, 100, 20, translate(ModInfo.ID + ".updater.never"), (btn) -> { - Config.Client.AutoUpdater.enableAutoUpdater.set(false); + Config.Client.Advanced.AutoUpdater.enableAutoUpdater.set(false); this.onClose(); }) ); diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/BatchGenerationEnvironment.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/BatchGenerationEnvironment.java index 779fbd029..266bb318f 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/BatchGenerationEnvironment.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/BatchGenerationEnvironment.java @@ -88,13 +88,13 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv { public static final ConfigBasedSpamLogger PREF_LOGGER = new ConfigBasedSpamLogger(LogManager.getLogger("LodWorldGen"), - () -> Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenPerformance.get(),1); + () -> Config.Client.Advanced.Logging.logWorldGenPerformance.get(),1); public static final ConfigBasedLogger EVENT_LOGGER = new ConfigBasedLogger(LogManager.getLogger("LodWorldGen"), - () -> Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenEvent.get()); + () -> Config.Client.Advanced.Logging.logWorldGenEvent.get()); public static final ConfigBasedLogger LOAD_LOGGER = new ConfigBasedLogger(LogManager.getLogger("LodWorldGen"), - () -> Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenLoadEvent.get()); + () -> Config.Client.Advanced.Logging.logWorldGenLoadEvent.get()); //TODO: Make actual proper support for StarLight @@ -234,7 +234,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv { if (!unsafeThreadingRecorded && !future.isDone()) { - EVENT_LOGGER.error("Unsafe Threading in Chunk Generator: ", new RuntimeException("Concurrent future")); + EVENT_LOGGER.error("Unsafe MultiThreading in Chunk Generator: ", new RuntimeException("Concurrent future")); EVENT_LOGGER.error("To increase stability, it is recommended to set world generation threads count to 1."); unsafeThreadingRecorded = true; } @@ -298,7 +298,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv if (unknownExceptionCount > EXCEPTION_COUNTER_TRIGGER) { EVENT_LOGGER.error("Too many exceptions in Batching World Generator! Disabling the generator."); unknownExceptionCount = 0; - Config.Client.WorldGenerator.enableDistantGeneration.set(false); + Config.Client.Advanced.WorldGenerator.enableDistantGeneration.set(false); } } @@ -396,7 +396,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv genEvent.refreshTimeout(); region = new LightedWorldGenRegion(params.level, lightEngine, referencedChunks, - ChunkStatus.STRUCTURE_STARTS, refSize/2, genEvent.lightMode, generator); + ChunkStatus.STRUCTURE_STARTS, refSize/2, generator); adaptor.setRegion(region); genEvent.threadedParam.makeStructFeat(region, params); genChunks = new ArrayGridList<>(referencedChunks, RANGE_TO_RANGE_EMPTY_EXTENSION, @@ -445,7 +445,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv { genEvent.resultConsumer.accept(wrappedChunk); } - if (genEvent.lightMode == ELightGenerationMode.FANCY || isFull) + if (isFull) { lightEngine.retainData(target.getPos(), false); } @@ -547,32 +547,37 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv finally { genEvent.timer.nextEvent("light"); - switch (region.lightMode) + + boolean useMinecraftLightingEngine = Config.Client.Advanced.WorldGenerator.lightingEngine.get() == ELightGenerationMode.MINECRAFT; + if (useMinecraftLightingEngine) { - case FANCY: + // generates chunk lighting using MC's methods + if (!Thread.interrupted()) { - stepLight.generateGroup(region.getLightEngine(), chunksToGenerate); + this.stepLight.generateGroup(region.getLightEngine(), chunksToGenerate); } - break; - case FAST: + } + else + { + // ignores lighting + chunksToGenerate.forEach((chunk) -> { if (chunk instanceof ProtoChunk) { chunk.setLightCorrect(true); // TODO why are we checking instanceof ProtoChunk? } - - #if POST_MC_1_18_1 + + #if POST_MC_1_18_1 if (chunk instanceof LevelChunk) { LevelChunk levelChunk = (LevelChunk) chunk; levelChunk.setLightCorrect(true); levelChunk.setClientLightReady(true); } - #endif + #endif }); - break; } genEvent.refreshTimeout(); diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GenerationEvent.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GenerationEvent.java index bbc4340ac..d2eca647c 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GenerationEvent.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/GenerationEvent.java @@ -46,7 +46,6 @@ public final class GenerationEvent public final DhChunkPos minPos; public final int size; public final EDhApiWorldGenerationStep targetGenerationStep; - public final ELightGenerationMode lightMode; public EventTimer timer = null; public long inQueueTime; public long timeoutTime = -1; @@ -64,7 +63,6 @@ public final class GenerationEvent this.size = size; this.targetGenerationStep = targetGenerationStep; this.threadedParam = ThreadedParameters.getOrMake(generationGroup.params); - this.lightMode = Config.Client.WorldGenerator.lightGenerationMode.get(); this.resultConsumer = resultConsumer; } diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/mimicObject/LightedWorldGenRegion.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/mimicObject/LightedWorldGenRegion.java index 8bd02810a..dc6830124 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/mimicObject/LightedWorldGenRegion.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/mimicObject/LightedWorldGenRegion.java @@ -62,7 +62,6 @@ public class LightedWorldGenRegion extends WorldGenRegion private static final Logger LOGGER = DhLoggerBuilder.getLogger(MethodHandles.lookup().lookupClass().getSimpleName()); public final WorldGenLevelLightEngine light; - public final ELightGenerationMode lightMode; public final EmptyChunkGenerator generator; public final int writeRadius; public final int size; @@ -92,17 +91,16 @@ public class LightedWorldGenRegion extends WorldGenRegion #endif public LightedWorldGenRegion(ServerLevel serverLevel, WorldGenLevelLightEngine lightEngine, - List list, ChunkStatus chunkStatus, int i, - ELightGenerationMode lightMode, EmptyChunkGenerator generator) + List chunkList, ChunkStatus chunkStatus, int writeRadius, + EmptyChunkGenerator generator) { - super(serverLevel, list #if POST_MC_1_17_1, chunkStatus, i #endif); - this.lightMode = lightMode; - this.firstPos = list.get(0).getPos(); + super(serverLevel, chunkList #if POST_MC_1_17_1, chunkStatus, writeRadius #endif); + this.firstPos = chunkList.get(0).getPos(); this.generator = generator; - light = lightEngine; - writeRadius = i; - cache = list; - size = Mth.floor(Math.sqrt(list.size())); + this.light = lightEngine; + this.writeRadius = writeRadius; + this.cache = chunkList; + this.size = Mth.floor(Math.sqrt(chunkList.size())); } #if POST_MC_1_17_1 @@ -258,52 +256,15 @@ public class LightedWorldGenRegion extends WorldGenRegion /** Overriding allows us to use our own lighting engine */ @Override - public LevelLightEngine getLightEngine() { - return light; - } - - /** Overriding allows us to use our own lighting engine */ - @Override - public int getBrightness(LightLayer lightLayer, BlockPos blockPos) - { - if (this.lightMode != ELightGenerationMode.FAST) - { - // MC lighting method - return this.light.getLayerListener(lightLayer).getLightValue(blockPos); - } - else - { - // Fallback DH lighting methods - - if (lightLayer == LightLayer.BLOCK) - { - return 0; - } - else - { - BlockPos heightmapPos = super.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, blockPos); - return (heightmapPos.getY() <= blockPos.getY()) ? this.getMaxLightLevel() : 0; - } - } - } + public LevelLightEngine getLightEngine() { return this.light; } /** Overriding allows us to use our own lighting engine */ @Override - public int getRawBrightness(BlockPos blockPos, int i) - { - if (this.lightMode != ELightGenerationMode.FAST) - { - // MC lighting method - return this.light.getRawBrightness(blockPos, i); - } - else - { - // Fallback DH lighting methods - - BlockPos heightmapPos = super.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, blockPos); - return (heightmapPos.getY() <= blockPos.getY()) ? this.getMaxLightLevel() : 0; - } - } + public int getBrightness(LightLayer lightLayer, BlockPos blockPos) { return this.light.getLayerListener(lightLayer).getLightValue(blockPos); } + + /** Overriding allows us to use our own lighting engine */ + @Override + public int getRawBrightness(BlockPos blockPos, int i) { return this.light.getRawBrightness(blockPos, i); } /** Overriding allows us to use our own lighting engine */ @Override diff --git a/coreSubProjects b/coreSubProjects index 3b4054c3c..f4ece1816 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 3b4054c3c771b0868450de6d6b9e31b723dc00af +Subproject commit f4ece1816da6acd03c4867633f3340aa0675cb43 diff --git a/fabric/src/main/java/com/seibel/lod/fabric/FabricMain.java b/fabric/src/main/java/com/seibel/lod/fabric/FabricMain.java index c3460a2d7..13a2183ab 100644 --- a/fabric/src/main/java/com/seibel/lod/fabric/FabricMain.java +++ b/fabric/src/main/java/com/seibel/lod/fabric/FabricMain.java @@ -51,7 +51,7 @@ public class FabricMain LOGGER.info("Post-Initializing Mod"); FabricDependencySetup.runDelayedSetup(); - if (Config.Client.Graphics.FogQuality.disableVanillaFog.get() && SingletonInjector.INSTANCE.get(IModChecker.class).isModLoaded("bclib")) + if (Config.Client.Advanced.Graphics.Fog.disableVanillaFog.get() && SingletonInjector.INSTANCE.get(IModChecker.class).isModLoaded("bclib")) ModAccessorInjector.INSTANCE.get(IBCLibAccessor.class).setRenderCustomFog(false); // Remove BCLib's fog LOGGER.info("Mod Post-Initialized"); diff --git a/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinFogRenderer.java b/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinFogRenderer.java index 2a66e1183..be2b9eabf 100644 --- a/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinFogRenderer.java +++ b/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinFogRenderer.java @@ -63,7 +63,7 @@ public class MixinFogRenderer { Entity entity = camera.getEntity(); boolean isSpecialFog = (entity instanceof LivingEntity) && ((LivingEntity) entity).hasEffect(MobEffects.BLINDNESS); if (!isSpecialFog && cameraNotInFluid && fogMode == FogMode.FOG_TERRAIN - && Config.Client.Graphics.FogQuality.disableVanillaFog.get()) + && Config.Client.Advanced.Graphics.Fog.disableVanillaFog.get()) { #if PRE_MC_1_17_1 RenderSystem.fogStart(A_REALLY_REALLY_BIG_VALUE); diff --git a/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinLevelRenderer.java b/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinLevelRenderer.java index ce1dfa66a..0335b4814 100644 --- a/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinLevelRenderer.java +++ b/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinLevelRenderer.java @@ -106,7 +106,8 @@ public class MixinLevelRenderer // // ClientApi.INSTANCE.renderLods(ClientLevelWrapper.getWrapper(level), mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks); // } - if (Config.Client.Advanced.lodOnlyMode.get()) { + if (Config.Client.Advanced.Debugging.lodOnlyMode.get()) + { callback.cancel(); } } diff --git a/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinMinecraft.java b/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinMinecraft.java index d579534cd..f5ce1334c 100644 --- a/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinMinecraft.java +++ b/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinMinecraft.java @@ -27,24 +27,28 @@ public class MixinMinecraft method = "(Lnet/minecraft/client/main/GameConfig;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V") ) - public void onOpenScreen(Minecraft instance, Screen guiScreen) { - if (!Config.Client.AutoUpdater.enableAutoUpdater.get()) { // Don't do anything if the user doesn't want it + public void onOpenScreen(Minecraft instance, Screen guiScreen) + { + if (!Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get()) + { + // Don't do anything if the user doesn't want it instance.setScreen(guiScreen); // Sets the screen back to the vanilla screen as if nothing ever happened return; } - if (SelfUpdater.onStart()) { + if (SelfUpdater.onStart()) + { instance.setScreen(new UpdateModScreen( new TitleScreen(false), // We don't want to use the vanilla title screen as it would fade the buttons ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()) )); - } else { + } + else + { instance.setScreen(guiScreen); // Sets the screen back to the vanilla screen as if nothing ever happened } } @Inject(at = @At("HEAD"), method = "close()V") - public void close(CallbackInfo ci) { - SelfUpdater.onClose(); - } + public void close(CallbackInfo ci) { SelfUpdater.onClose(); } } diff --git a/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinTextureUtil.java b/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinTextureUtil.java index 838498a34..a7b44bda6 100644 --- a/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinTextureUtil.java +++ b/fabric/src/main/java/com/seibel/lod/fabric/mixins/client/MixinTextureUtil.java @@ -17,7 +17,7 @@ public class MixinTextureUtil { @Redirect(method = "Lcom/mojang/blaze3d/platform/TextureUtil;prepareImage(Lcom/mojang/blaze3d/platform/NativeImage$InternalGlFormat;IIII)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;_texParameter(IIF)V", remap=false)) private static void setLodBias(int target, int pname, float param) { - float biasValue = Config.Client.Graphics.AdvancedGraphics.lodBias.get().floatValue(); + float biasValue = Config.Client.Advanced.Graphics.AdvancedGraphics.lodBias.get().floatValue(); if (biasValue != 0) { // The target is GL11.GL_TEXTURE_2D // And the pname is GL14.GL_TEXTURE_LOD_BIAS diff --git a/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinFogRenderer.java b/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinFogRenderer.java index f3425398a..ace2b6b5a 100644 --- a/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinFogRenderer.java +++ b/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinFogRenderer.java @@ -64,7 +64,7 @@ public class MixinFogRenderer { Entity entity = camera.getEntity(); boolean isSpecialFog = (entity instanceof LivingEntity) && ((LivingEntity) entity).hasEffect(MobEffects.BLINDNESS); if (!isSpecialFog && cameraNotInFluid && fogMode == FogMode.FOG_TERRAIN - && Config.Client.Graphics.FogQuality.disableVanillaFog.get()) + && Config.Client.Advanced.Graphics.Fog.disableVanillaFog.get()) { #if PRE_MC_1_17_1 RenderSystem.fogStart(A_REALLY_REALLY_BIG_VALUE); diff --git a/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinLevelRenderer.java b/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinLevelRenderer.java index acac44c2e..763ddb163 100644 --- a/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinLevelRenderer.java +++ b/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinLevelRenderer.java @@ -114,7 +114,9 @@ public class MixinLevelRenderer ClientApi.INSTANCE.renderLods(ClientLevelWrapper.getWrapper(level), mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks); } - if (Config.Client.Advanced.lodOnlyMode.get()) { + + if (Config.Client.Advanced.Debugging.lodOnlyMode.get()) + { callback.cancel(); } } diff --git a/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinMinecraft.java b/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinMinecraft.java index 0797092b6..bc9684194 100644 --- a/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinMinecraft.java +++ b/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinMinecraft.java @@ -27,8 +27,11 @@ public class MixinMinecraft method = "(Lnet/minecraft/client/main/GameConfig;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V") ) - public void onOpenScreen(Minecraft instance, Screen guiScreen) { - if (!Config.Client.AutoUpdater.enableAutoUpdater.get()) { // Don't do anything if the user doesn't want it + public void onOpenScreen(Minecraft instance, Screen guiScreen) + { + if (!Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get()) + { + // Don't do anything if the user doesn't want it instance.setScreen(guiScreen); // Sets the screen back to the vanilla screen as if nothing ever happened return; } diff --git a/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinTextureUtil.java b/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinTextureUtil.java index 3fbc52679..4f4936f48 100644 --- a/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinTextureUtil.java +++ b/forge/src/main/java/com/seibel/lod/forge/mixins/client/MixinTextureUtil.java @@ -16,8 +16,9 @@ import org.spongepowered.asm.mixin.injection.Redirect; public class MixinTextureUtil { @Redirect(method = "Lcom/mojang/blaze3d/platform/TextureUtil;prepareImage(Lcom/mojang/blaze3d/platform/NativeImage$InternalGlFormat;IIII)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;_texParameter(IIF)V", remap=false)) - private static void setLodBias(int target, int pname, float param) { - float biasValue = Config.Client.Graphics.AdvancedGraphics.lodBias.get().floatValue(); + private static void setLodBias(int target, int pname, float param) + { + float biasValue = Config.Client.Advanced.Graphics.AdvancedGraphics.lodBias.get().floatValue(); if (biasValue != 0) { // The target is GL11.GL_TEXTURE_2D // And the pname is GL14.GL_TEXTURE_LOD_BIAS