diff --git a/build.gradle b/build.gradle index 13349022..f4ecb764 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ subprojects { withSourcesJar() toolchain { - languageVersion = JavaLanguageVersion.of(21) + languageVersion = JavaLanguageVersion.of(8) } } @@ -60,7 +60,7 @@ subprojects { it.options.encoding = "UTF-8" javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(21) + languageVersion = JavaLanguageVersion.of(8) } } } diff --git a/gradle.properties b/gradle.properties index 3c726199..74141922 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,5 +7,4 @@ mod_version = 3.4.3 maven_group = juliand665 archives_base_name = dynamic-fps -enabled_platforms=fabric -# enabled_platforms=fabric,forge,neoforge,quilt +enabled_platforms=fabric,forge diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 561bcff4..9e75534f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,22 +1,22 @@ [versions] -minecraft = "1.20.5-rc2" +minecraft = "1.16.5" # Platform libraries fabric_loader = "0.15.10" -fabric_api = "0.97.4+1.20.5" +fabric_api = "0.29.4+1.16" -forge = "1.20.4-49.0.30" +forge = "1.16.5-36.2.41" neoforge = "20.4.160-beta" quilt_loader = "0.25.0" -quilt_standard_libraries = "8.0.0-alpha.12+1.20.4" +quilt_standard_libraries = "1.1.0-beta.26+1.18.2" # Third-party libraries -modmenu = "10.0.0-alpha.3" -cloth_config = "14.0.125" +modmenu = "1.16.23" +cloth_config = "4.17.101" mixinextras = "0.3.5" diff --git a/platforms/common/src/main/java/dynamic_fps/impl/DynamicFPSMod.java b/platforms/common/src/main/java/dynamic_fps/impl/DynamicFPSMod.java index bed5f2f0..0801e6a3 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/DynamicFPSMod.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/DynamicFPSMod.java @@ -5,7 +5,9 @@ import dynamic_fps.impl.config.DynamicFPSConfig; import dynamic_fps.impl.service.ModCompat; import dynamic_fps.impl.util.Logging; +import dynamic_fps.impl.util.ModCompatHelper; import dynamic_fps.impl.util.OptionsHolder; +import dynamic_fps.impl.util.duck.DuckScreen; import dynamic_fps.impl.util.duck.DuckLoadingOverlay; import dynamic_fps.impl.util.duck.DuckSoundEngine; import dynamic_fps.impl.util.event.InputObserver; @@ -51,8 +53,10 @@ public class DynamicFPSMod { // Internal "API" for Dynamic FPS itself public static void init() { + ModCompatHelper.init(); + Platform platform = Platform.getInstance(); - String version = platform.getModVersion(Constants.MOD_ID).orElseThrow(); + String version = platform.getModVersion(Constants.MOD_ID).orElseThrow(RuntimeException::new); Logging.getLogger().info("Dynamic FPS {} active on {}!", version, platform.getName()); } @@ -159,11 +163,15 @@ public static boolean shouldShowToasts() { } public static boolean shouldShowLevels() { - return isDisabled() || !isLevelCoveredByOverlay(); + return isDisabled() || !(isLevelCoveredByScreen() || isLevelCoveredByOverlay()); } // Internal logic + private static boolean isLevelCoveredByScreen() { + return minecraft.screen != null && ((DuckScreen) minecraft.screen).dynamic_fps$rendersBackground(); + } + private static boolean isIdle() { long idleTime = modConfig.idleTime(); diff --git a/platforms/common/src/main/java/dynamic_fps/impl/compat/ClothConfig.java b/platforms/common/src/main/java/dynamic_fps/impl/compat/ClothConfig.java index b4a71277..7c224c17 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/compat/ClothConfig.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/compat/ClothConfig.java @@ -10,8 +10,9 @@ import me.shedaniel.clothconfig2.impl.builders.SubCategoryBuilder; import net.minecraft.ChatFormatting; import net.minecraft.client.gui.screens.Screen; -import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.sounds.SoundSource; import java.util.Locale; @@ -43,7 +44,7 @@ public static Screen genConfigScreen(Screen parent) { ); general.addEntry( - entryBuilder.startTextDescription(CommonComponents.SPACE).build() + entryBuilder.startTextDescription(new TextComponent(" ")).build() ); general.addEntry( @@ -101,7 +102,7 @@ public static Screen genConfigScreen(Screen parent) { volumes.add( entryBuilder.startIntSlider( - Component.translatable("soundCategory." + name), + new TranslatableComponent("soundCategory." + name), (int) (config.rawVolumeMultiplier(source) * 100), 0, 100 ) @@ -123,7 +124,7 @@ public static Screen genConfigScreen(Screen parent) { .setDefaultValue(standard.graphicsState()) .setSaveConsumer(config::setGraphicsState) .setEnumNameProvider(ClothConfig::graphicsStateMessage) - .setTooltipSupplier(ClothConfig::graphicsStateTooltip) + .setTooltipSupplier((selected) -> ClothConfig.graphicsStateTooltip((GraphicsState) selected)) // what .build() ); @@ -173,14 +174,14 @@ private static int fromConfigFpsTarget(int value) { private static Component fpsTargetMessage(int value) { if (toConfigFpsTarget(value) != -1) { - return Component.translatable("options.framerate", value); + return new TranslatableComponent("options.framerate", value); } else { - return Component.translatable("options.framerateLimit.max"); + return new TranslatableComponent("options.framerateLimit.max"); } } private static Component volumeMultiplierMessage(int value) { - return Component.literal(Integer.toString(value) + "%"); + return new TranslatableComponent(Integer.toString(value) + "%"); } private static Component graphicsStateMessage(Enum graphicsState) { diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/MinecraftMixin.java b/platforms/common/src/main/java/dynamic_fps/impl/mixin/MinecraftMixin.java index ce385c3d..51aeff74 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/MinecraftMixin.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/mixin/MinecraftMixin.java @@ -48,7 +48,7 @@ private void getFramerateLimit(CallbackInfoReturnable callbackInfo) { callbackInfo.setReturnValue(limit); } } else if (DynamicFPSMod.uncapMenuFrameRate()) { - if (this.options.enableVsync().get()) { + if (this.options.enableVsync) { // VSync will regulate to a non-infinite value callbackInfo.setReturnValue(NO_FRAME_RATE_LIMIT); } else { diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/ScreenMixin.java b/platforms/common/src/main/java/dynamic_fps/impl/mixin/ScreenMixin.java new file mode 100644 index 00000000..7f39e351 --- /dev/null +++ b/platforms/common/src/main/java/dynamic_fps/impl/mixin/ScreenMixin.java @@ -0,0 +1,50 @@ +package dynamic_fps.impl.mixin; + +import dynamic_fps.impl.service.ModCompat; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import dynamic_fps.impl.util.duck.DuckScreen; +import net.minecraft.client.gui.screens.Screen; + +@Mixin(Screen.class) +public class ScreenMixin implements DuckScreen { + @Unique + private boolean dynamic_fps$canOptimize = false; + + @Unique + private boolean dynamic_fps$hasOptedOut = false; + + @Override + public boolean dynamic_fps$rendersBackground() { + return dynamic_fps$canOptimize; + } + + @Override + public void dynamic_fps$setRendersBackground() { + this.dynamic_fps$canOptimize = true; + } + + @Inject(method = "init", at = @At("HEAD")) + private void onInit(CallbackInfo callbackInfo) { + String name = this.getClass().getName(); + + this.dynamic_fps$hasOptedOut = ModCompat.getInstance().isScreenOptedOut(name); + + // Allow other mods to opt out on behalf of vanilla screens + // That Dynamic FPS forced to opt in via its own mod metadata. + if (!this.dynamic_fps$hasOptedOut) { + this.dynamic_fps$canOptimize = ModCompat.getInstance().isScreenOptedIn(name); + } + } + + @Inject(method = "renderDirtBackground", at = @At("HEAD")) + private void onRenderDirtBackground(CallbackInfo callbackInfo) { + if (!this.dynamic_fps$hasOptedOut) { + this.dynamic_fps$canOptimize = true; // Signal to apply optimizations on next frame + } + } +} diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/StatsScreenMixin.java b/platforms/common/src/main/java/dynamic_fps/impl/mixin/StatsScreenMixin.java new file mode 100644 index 00000000..92b1b5ac --- /dev/null +++ b/platforms/common/src/main/java/dynamic_fps/impl/mixin/StatsScreenMixin.java @@ -0,0 +1,17 @@ +package dynamic_fps.impl.mixin; + +import dynamic_fps.impl.util.duck.DuckScreen; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.screens.achievement.StatsScreen; + +@Mixin(StatsScreen.class) +public class StatsScreenMixin { + @Inject(method = "onStatsUpdated", at = @At("HEAD")) + private void onStatsUpdated(CallbackInfo callbackInfo) { + ((DuckScreen) this).dynamic_fps$setRendersBackground(); + } +} diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/ToastComponentMixin.java b/platforms/common/src/main/java/dynamic_fps/impl/mixin/ToastComponentMixin.java index 52368925..03f2694b 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/ToastComponentMixin.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/mixin/ToastComponentMixin.java @@ -1,19 +1,23 @@ package dynamic_fps.impl.mixin; +import java.util.Deque; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.Redirect; import dynamic_fps.impl.DynamicFPSMod; +import net.minecraft.client.gui.components.toasts.Toast; import net.minecraft.client.gui.components.toasts.ToastComponent; @Mixin(ToastComponent.class) public class ToastComponentMixin { - @Inject(method = "freeSlots", at = @At("HEAD"), cancellable = true) - private void hasFreeSlots(CallbackInfoReturnable callbackInfo) { + @Redirect(method = "render", at = @At(value = "INVOKE", target = "Ljava/util/Deque;isEmpty()Z")) + private boolean onQueueIsEmpty(Deque queued) { if (!DynamicFPSMod.shouldShowToasts()) { - callbackInfo.setReturnValue(0); + return true; + } else { + return queued.isEmpty(); } } } diff --git a/platforms/common/src/main/java/dynamic_fps/impl/service/ModCompat.java b/platforms/common/src/main/java/dynamic_fps/impl/service/ModCompat.java index cf619945..bbfdbc53 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/service/ModCompat.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/service/ModCompat.java @@ -7,6 +7,17 @@ public interface ModCompat { boolean disableOverlayOptimization(); + Set getOptedInScreens(); + Set getOptedOutScreens(); + + default boolean isScreenOptedIn(String className) { + return getOptedInScreens().contains(className); + } + + default boolean isScreenOptedOut(String className) { + return getOptedOutScreens().contains(className); + } + static ModCompat getInstance() { return Services.MOD_COMPAT; } diff --git a/platforms/common/src/main/java/dynamic_fps/impl/service/Services.java b/platforms/common/src/main/java/dynamic_fps/impl/service/Services.java index 2b8e5bc5..23eb598e 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/service/Services.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/service/Services.java @@ -1,6 +1,6 @@ package dynamic_fps.impl.service; -import java.util.Optional; +import java.util.NoSuchElementException; import java.util.ServiceLoader; class Services { @@ -8,11 +8,9 @@ class Services { static ModCompat MOD_COMPAT = loadService(ModCompat.class); static T loadService(Class type) { - Optional optional = ServiceLoader.load(type).findFirst(); - - if (optional.isPresent()) { - return optional.get(); - } else { + try { + return ServiceLoader.load(type).iterator().next(); + } catch (NoSuchElementException e) { throw new RuntimeException("Failed to load Dynamic FPS " + type.getSimpleName() + " service!"); } } diff --git a/platforms/common/src/main/java/dynamic_fps/impl/util/HudInfoRenderer.java b/platforms/common/src/main/java/dynamic_fps/impl/util/HudInfoRenderer.java index 1114cba3..7ed00452 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/util/HudInfoRenderer.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/util/HudInfoRenderer.java @@ -2,44 +2,37 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.Font.DisplayMode; import net.minecraft.network.chat.Component; import static dynamic_fps.impl.util.Localization.localized; -import org.joml.Matrix4f; +import com.mojang.blaze3d.vertex.PoseStack; import dynamic_fps.impl.DynamicFPSMod; public final class HudInfoRenderer { private static final Minecraft minecraft = Minecraft.getInstance(); - public static void renderInfo(GuiGraphics guiGraphics) { + public static void renderInfo(PoseStack poseStack) { if (DynamicFPSMod.disabledByUser()) { - drawCenteredText(guiGraphics, localized("gui", "hud.disabled"), 32); + drawCenteredText(poseStack, localized("gui", "hud.disabled"), 32); } else if (DynamicFPSMod.isForcingLowFPS()) { - drawCenteredText(guiGraphics, localized("gui", "hud.reducing"), 32); + drawCenteredText(poseStack, localized("gui", "hud.reducing"), 32); } } - private static void drawCenteredText(GuiGraphics guiGraphics, Component component, float y) { + private static void drawCenteredText(PoseStack poseStack, Component component, float y) { Font fontRenderer = minecraft.gui.getFont(); int stringWidth = fontRenderer.width(component); int windowWidth = minecraft.getWindow().getGuiScaledWidth(); - fontRenderer.drawInBatch( + fontRenderer.drawShadow( + poseStack, component, (windowWidth - stringWidth) / 2f, y, - 0xFFFFFFFF, - true, - new Matrix4f(), - guiGraphics.bufferSource(), - DisplayMode.NORMAL, - 0, - 255 + 0xFFFFFFFF ); } } diff --git a/platforms/common/src/main/java/dynamic_fps/impl/util/Localization.java b/platforms/common/src/main/java/dynamic_fps/impl/util/Localization.java index bd3d95e0..0fd1579e 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/util/Localization.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/util/Localization.java @@ -1,8 +1,8 @@ package dynamic_fps.impl.util; import dynamic_fps.impl.Constants; -import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.network.chat.TranslatableComponent; public final class Localization { /** e.g. keyString("title", "config") -> "title.dynamic_fps.config") */ @@ -11,7 +11,7 @@ public static String translationKey(String domain, String path) { } public static MutableComponent localized(String domain, String path, Object... args) { - return Component.translatable(translationKey(domain, path), args); + return new TranslatableComponent(translationKey(domain, path), args); } private Localization() {} diff --git a/platforms/common/src/main/java/dynamic_fps/impl/util/Logging.java b/platforms/common/src/main/java/dynamic_fps/impl/util/Logging.java index f510adfb..a0911c62 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/util/Logging.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/util/Logging.java @@ -1,11 +1,11 @@ package dynamic_fps.impl.util; import dynamic_fps.impl.Constants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public class Logging { - private static final Logger logger = LoggerFactory.getLogger(Constants.MOD_ID); + private static final Logger logger = LogManager.getLogger(Constants.MOD_ID); public static Logger getLogger() { return logger; diff --git a/platforms/common/src/main/java/dynamic_fps/impl/util/ModCompatHelper.java b/platforms/common/src/main/java/dynamic_fps/impl/util/ModCompatHelper.java new file mode 100644 index 00000000..fef58166 --- /dev/null +++ b/platforms/common/src/main/java/dynamic_fps/impl/util/ModCompatHelper.java @@ -0,0 +1,42 @@ +package dynamic_fps.impl.util; + +import dynamic_fps.impl.service.ModCompat; +import dynamic_fps.impl.service.Platform; + +import java.util.Arrays; +import java.util.Optional; + +public class ModCompatHelper { + public static void init() { + fixFastloadSoftLock(); + } + + /** + * Fix softlock in combination with Fastload <=3.4.0 due to our screen / loading overlay optimization. + * + * See the issue report for more info. + */ + private static void fixFastloadSoftLock() { + Optional optional = Platform.getInstance().getModVersion("fastload"); + + if (!optional.isPresent()) { + return; + } + + String[] parts = optional.get().split("\\."); + int[] version = Arrays.stream(parts).mapToInt(Integer::parseInt).toArray(); + + if (version.length < 3) { + Logging.getLogger().warn("Unable to parse Fastload version: {}!", optional.get()); + return; + } + + // If a version below 3.4.0 is present opt their custom world loading screen out of our optimization + if (!(version[0] > 3 || version[0] == 3 && (version[1] > 4 || version[1] == 4 && version[2] > 0))) { + ModCompat.getInstance().getOptedOutScreens().add( + "io.github.bumblesoftware.fastload.client.BuildingTerrainScreen" + ); + + } + } +} diff --git a/platforms/common/src/main/java/dynamic_fps/impl/util/OptionsHolder.java b/platforms/common/src/main/java/dynamic_fps/impl/util/OptionsHolder.java index f22862e3..3c9799bc 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/util/OptionsHolder.java +++ b/platforms/common/src/main/java/dynamic_fps/impl/util/OptionsHolder.java @@ -1,6 +1,7 @@ package dynamic_fps.impl.util; import dynamic_fps.impl.GraphicsState; +import net.minecraft.client.AmbientOcclusionStatus; import net.minecraft.client.CloudStatus; import net.minecraft.client.GraphicsStatus; import net.minecraft.client.Options; @@ -14,10 +15,10 @@ public class OptionsHolder { private static CloudStatus cloudStatus; private static GraphicsStatus graphicsStatus; - private static boolean ambientOcclusion; + private static AmbientOcclusionStatus ambientOcclusion; private static ParticleStatus particlesStatus; private static boolean entityShadows; - private static double entityDistance; + private static float entityDistance; /* * Create an in-memory copy of current vanilla graphics options. @@ -25,12 +26,12 @@ public class OptionsHolder { * This MUST be called while graphics options have not been changed yet. */ public static void copyOptions(Options options) { - cloudStatus = options.getCloudsType(); - graphicsStatus = options.graphicsMode().get(); - ambientOcclusion = options.ambientOcclusion().get(); - particlesStatus = options.particles().get(); - entityShadows = options.entityShadows().get(); - entityDistance = options.entityDistanceScaling().get(); + cloudStatus = options.renderClouds; + graphicsStatus = options.graphicsMode; + ambientOcclusion = options.ambientOcclusion; + particlesStatus = options.particles; + entityShadows = options.entityShadows; + entityDistance = options.entityDistanceScaling; } /* @@ -38,21 +39,21 @@ public static void copyOptions(Options options) { */ public static void applyOptions(Options options, GraphicsState state) { if (state == GraphicsState.DEFAULT) { - options.cloudStatus().set(cloudStatus); - options.graphicsMode().set(graphicsStatus); - options.ambientOcclusion().set(ambientOcclusion); - options.particles().set(particlesStatus); - options.entityShadows().set(entityShadows); - options.entityDistanceScaling().set(entityDistance); + options.renderClouds = cloudStatus; + options.graphicsMode = graphicsStatus; + options.ambientOcclusion = ambientOcclusion; + options.particles = particlesStatus; + options.entityShadows = entityShadows; + options.entityDistanceScaling = entityDistance; } else { // state == GraphicsState.REDUCED - options.cloudStatus().set(CloudStatus.OFF); - options.particles().set(ParticleStatus.MINIMAL); - options.entityShadows().set(false); - options.entityDistanceScaling().set(0.5); + options.renderClouds = CloudStatus.OFF; + options.particles = ParticleStatus.MINIMAL; + options.entityShadows = false; + options.entityDistanceScaling = 0.5f; if (state == GraphicsState.MINIMAL) { - options.graphicsMode().set(GraphicsStatus.FAST); - options.ambientOcclusion().set(false); + options.graphicsMode = GraphicsStatus.FAST; + options.ambientOcclusion = AmbientOcclusionStatus.OFF; } } } diff --git a/platforms/common/src/main/java/dynamic_fps/impl/util/duck/DuckScreen.java b/platforms/common/src/main/java/dynamic_fps/impl/util/duck/DuckScreen.java new file mode 100644 index 00000000..6d560e40 --- /dev/null +++ b/platforms/common/src/main/java/dynamic_fps/impl/util/duck/DuckScreen.java @@ -0,0 +1,11 @@ +package dynamic_fps.impl.util.duck; + +public interface DuckScreen { + public default boolean dynamic_fps$rendersBackground() { + throw new RuntimeException("No implementation for dynamic_fps$rendersBackground was found."); + } + + public default void dynamic_fps$setRendersBackground() { + throw new RuntimeException("No implementation for dynamic_fps$rendersBackground was found."); + } +} diff --git a/platforms/common/src/main/resources/dynamic_fps-common.mixins.json b/platforms/common/src/main/resources/dynamic_fps-common.mixins.json index a8037d96..8a258846 100644 --- a/platforms/common/src/main/resources/dynamic_fps-common.mixins.json +++ b/platforms/common/src/main/resources/dynamic_fps-common.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "dynamic_fps.impl.mixin", - "compatibilityLevel": "JAVA_21", + "compatibilityLevel": "JAVA_8", "minVersion": "0.8", "client": [ "DebugScreenOverlayMixin", @@ -9,7 +9,9 @@ "GuiMixin", "LoadingOverlayMixin", "MinecraftMixin", + "ScreenMixin", "SoundEngineMixin", + "StatsScreenMixin", "ToastComponentMixin", "WindowMixin", "bugfix.BlockableEventLoopMixin" diff --git a/platforms/fabric/src/main/java/net/lostluma/dynamic_fps/impl/fabric/mixin/GuiMixin.java b/platforms/fabric/src/main/java/net/lostluma/dynamic_fps/impl/fabric/mixin/GuiMixin.java index 95139187..b0e54663 100644 --- a/platforms/fabric/src/main/java/net/lostluma/dynamic_fps/impl/fabric/mixin/GuiMixin.java +++ b/platforms/fabric/src/main/java/net/lostluma/dynamic_fps/impl/fabric/mixin/GuiMixin.java @@ -1,9 +1,9 @@ package net.lostluma.dynamic_fps.impl.fabric.mixin; import com.llamalad7.mixinextras.sugar.Local; +import com.mojang.blaze3d.vertex.PoseStack; import dynamic_fps.impl.util.HudInfoRenderer; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiGraphics; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -14,8 +14,14 @@ public class GuiMixin { /** * Render info on whether Dynamic FPS is disabled or always reducing the user's FPS. */ - @Inject(method = "renderSavingIndicator", at = @At("HEAD")) - private void renderSavingIndicator(CallbackInfo callbackInfo, @Local GuiGraphics guiGraphics) { - HudInfoRenderer.renderInfo(guiGraphics); + @Inject( + method = "render", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/gui/Gui;renderHotbar(FLcom/mojang/blaze3d/vertex/PoseStack;)V" + ) + ) + private void render(CallbackInfo callbackInfo, @Local PoseStack poseStack) { + HudInfoRenderer.renderInfo(poseStack); } } diff --git a/platforms/fabric/src/main/java/net/lostluma/dynamic_fps/impl/fabric/service/FabricModCompat.java b/platforms/fabric/src/main/java/net/lostluma/dynamic_fps/impl/fabric/service/FabricModCompat.java index 473389b2..8a5c038f 100644 --- a/platforms/fabric/src/main/java/net/lostluma/dynamic_fps/impl/fabric/service/FabricModCompat.java +++ b/platforms/fabric/src/main/java/net/lostluma/dynamic_fps/impl/fabric/service/FabricModCompat.java @@ -2,15 +2,22 @@ import dynamic_fps.impl.service.ModCompat; import net.fabricmc.loader.api.FabricLoader; +import net.fabricmc.loader.api.MappingResolver; import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.metadata.CustomValue; import net.fabricmc.loader.api.metadata.ModMetadata; import net.lostluma.dynamic_fps.impl.fabric.compat.FREX; import org.jetbrains.annotations.Nullable; +import java.util.HashSet; +import java.util.Set; + public class FabricModCompat implements ModCompat { private static boolean disableOverlayOptimization = false; + private static final Set optedInScreens = new HashSet<>(); + private static final Set optedOutScreens = new HashSet<>(); + static { FabricLoader.getInstance().getAllMods().forEach(FabricModCompat::parseModMetadata); } @@ -25,6 +32,17 @@ public boolean disableOverlayOptimization() { return disableOverlayOptimization; } + + @Override + public Set getOptedInScreens() { + return optedInScreens; + } + + @Override + public Set getOptedOutScreens() { + return optedOutScreens; + } + private static void parseModMetadata(ModContainer mod) { CustomValue.CvObject root; ModMetadata data = mod.getMetadata(); @@ -36,6 +54,9 @@ private static void parseModMetadata(ModContainer mod) { } parseOverlayOverride(root.get("optimized_overlay")); + + parseScreenOverrides(root.get("optimized_screens"), "enabled", optedInScreens); + parseScreenOverrides(root.get("optimized_screens"), "disabled", optedOutScreens); } private static void parseOverlayOverride(@Nullable CustomValue value) { @@ -43,4 +64,25 @@ private static void parseOverlayOverride(@Nullable CustomValue value) { disableOverlayOptimization = true; } } + + private static void parseScreenOverrides(@Nullable CustomValue parent, String type, Set set) { + if (parent == null || parent.getType() != CustomValue.CvType.OBJECT) { + return; + } + + CustomValue values = parent.getAsObject().get(type); + + if (values == null || values.getType() != CustomValue.CvType.ARRAY) { + return; + } + + MappingResolver resolver = FabricLoader.getInstance().getMappingResolver(); + + values.getAsArray().forEach(value -> { + if (value.getType() == CustomValue.CvType.STRING) { + // Translate from intermediary to runtime names for vanilla screens + set.add(resolver.mapClassName("intermediary", value.getAsString())); + } + }); + } } diff --git a/platforms/fabric/src/main/resources/dynamic_fps.mixins.json b/platforms/fabric/src/main/resources/dynamic_fps.mixins.json index ad91e785..7610a86c 100644 --- a/platforms/fabric/src/main/resources/dynamic_fps.mixins.json +++ b/platforms/fabric/src/main/resources/dynamic_fps.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "net.lostluma.dynamic_fps.impl.fabric.mixin", - "compatibilityLevel": "JAVA_21", + "compatibilityLevel": "JAVA_8", "minVersion": "0.8", "client": [ "GuiMixin", diff --git a/platforms/fabric/src/main/resources/fabric.mod.json b/platforms/fabric/src/main/resources/fabric.mod.json index 2aac1bb3..a81ba9a4 100644 --- a/platforms/fabric/src/main/resources/fabric.mod.json +++ b/platforms/fabric/src/main/resources/fabric.mod.json @@ -64,7 +64,7 @@ }, "depends": { "fabricloader": ">=0.15.10", - "minecraft": ">=1.20.5-alpha.24.14.a", + "minecraft": "=1.16.5", "mixinextras": ">=0.3.2", "fabric-resource-loader-v0": "*", "fabric-lifecycle-events-v1": "*" @@ -82,5 +82,41 @@ "dynamic_fps.mixins.json", "dynamic_fps-common.mixins.json" ], - "accessWidener": "dynamic_fps.accesswidener" + "accessWidener": "dynamic_fps.accesswidener", + "custom": { + "dynamic_fps": { + "optimized_screens": { + "enabled": [ + "net.minecraft.class_4189", + "net.minecraft.class_404", + "net.minecraft.class_426", + "net.minecraft.class_4288", + "net.minecraft.class_6777", + "net.minecraft.class_446", + "net.minecraft.class_445", + "net.minecraft.class_6599" + ], + "disabled": [ + "net.minecraft.class_434" + ], + "_comment": { + "_0": "Mojang mapping names of the enabled / disabled screens.", + "_1": "Sorted by fully qualified name. Translation not needed for mod screens.", + "enabled": { + "net.minecraft.class_4189": "net.minecraft.client.gui.screens.AccessibilityOptionsScreen", + "net.minecraft.class_404": "net.minecraft.client.gui.screens.ChatOptionsScreen", + "net.minecraft.class_426": "net.minecraft.client.gui.screens.LanguageSelectScreen", + "net.minecraft.class_4288": "net.minecraft.client.gui.screens.MouseSettingsScreen", + "net.minecraft.class_6777": "net.minecraft.client.gui.screens.OnlineOptionsScreen", + "net.minecraft.class_446": "net.minecraft.client.gui.screens.VideoSettingsScreen", + "net.minecraft.class_445": "net.minecraft.client.gui.screens.WinScreen", + "net.minecraft.class_6599": "net.minecraft.client.gui.screens.controls.KeyBindsScreen" + }, + "disabled": { + "net.minecraft.class_434": "net.minecraft.client.gui.screens.ReceivingLevelScreen" + } + } + } + } + } } diff --git a/platforms/forge/build.gradle b/platforms/forge/build.gradle index c7381cd6..6b0d3254 100644 --- a/platforms/forge/build.gradle +++ b/platforms/forge/build.gradle @@ -52,6 +52,8 @@ shadowJar { exclude "fabric.mod.json" exclude "architectury.common.json" + exclude "assets/dynamic_fps/icon.png" + configurations = [project.configurations.shadowCommon] } diff --git a/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/DynamicFPSForgeMod.java b/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/DynamicFPSForgeMod.java index 29a4106a..11338226 100644 --- a/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/DynamicFPSForgeMod.java +++ b/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/DynamicFPSForgeMod.java @@ -4,15 +4,14 @@ import dynamic_fps.impl.DynamicFPSMod; import dynamic_fps.impl.compat.ClothConfig; import dynamic_fps.impl.service.Platform; -import dynamic_fps.impl.util.HudInfoRenderer; import dynamic_fps.impl.util.KeyMappingHandler; -import net.minecraftforge.client.ConfigScreenHandler; -import net.minecraftforge.client.event.RegisterKeyMappingsEvent; -import net.minecraftforge.client.event.RenderGuiOverlayEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.TickEvent; +import net.minecraftforge.fml.ExtensionPoint; import net.minecraftforge.fml.ModLoadingContext; +import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.loading.FMLLoader; @@ -23,7 +22,7 @@ public class DynamicFPSForgeMod { private static final List TICK_EVENT_LISTENERS = new ArrayList<>(); - public DynamicFPSForgeMod() { + public DynamicFPSForgeMod() { if (FMLLoader.getDist().isDedicatedServer()) { return; } @@ -31,25 +30,17 @@ public DynamicFPSForgeMod() { DynamicFPSMod.init(); ModLoadingContext.get().registerExtensionPoint( - ConfigScreenHandler.ConfigScreenFactory.class, - () -> new ConfigScreenHandler.ConfigScreenFactory( - (minecraft, screen) -> ClothConfig.genConfigScreen(screen) - ) + ExtensionPoint.CONFIGGUIFACTORY, + () -> (minecraft, screen) -> ClothConfig.genConfigScreen(screen) ); MinecraftForge.EVENT_BUS.addListener(this::onClientTick); - MinecraftForge.EVENT_BUS.addListener(this::renderGuiOverlay); - FMLJavaModLoadingContext.get().getModEventBus().addListener(this::registerKeyMappings); - } - - public void renderGuiOverlay(RenderGuiOverlayEvent event) { - HudInfoRenderer.renderInfo(event.getGuiGraphics()); } - public void registerKeyMappings(RegisterKeyMappingsEvent event) { + public void registerKeyMappings(FMLClientSetupEvent event) { for (KeyMappingHandler handler : KeyMappingHandler.getHandlers()) { - event.register(handler.keyMapping()); + ClientRegistry.registerKeyBinding(handler.keyMapping()); } } diff --git a/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/mixin/GameRendererMixin.java b/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/mixin/GameRendererMixin.java new file mode 100644 index 00000000..3422af32 --- /dev/null +++ b/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/mixin/GameRendererMixin.java @@ -0,0 +1,39 @@ +package net.lostluma.dynamic_fps.impl.forge.mixin; + +import dynamic_fps.impl.DynamicFPSMod; +import net.minecraft.Util; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GameRenderer; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(GameRenderer.class) +public class GameRendererMixin { + @Shadow + @Final + private Minecraft minecraft; + + @Shadow + private long lastActiveTime; + + // Duplicate of common mixin w/o mixinextras and injected earlier + // Since the original just does not activate at all on Forge ...? + // We have to add the pause on lost focus feature ourselves sadly + @Inject(method = "render", at = @At("HEAD"), cancellable = true) + private void skipRendering(CallbackInfo callbackInfo) { + if (!DynamicFPSMod.checkForRender()) { + callbackInfo.cancel(); + + // Copy of vanilla code + if (this.minecraft.isWindowActive() || !this.minecraft.options.pauseOnLostFocus || this.minecraft.options.touchscreen && this.minecraft.mouseHandler.isRightPressed()) { + this.lastActiveTime = Util.getMillis(); + } else if (Util.getMillis() - this.lastActiveTime > 500L) { + this.minecraft.pauseGame(false); + } + } + } +} diff --git a/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/service/ForgeModCompat.java b/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/service/ForgeModCompat.java index 4f47fadb..b177a685 100644 --- a/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/service/ForgeModCompat.java +++ b/platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/service/ForgeModCompat.java @@ -1,9 +1,20 @@ package net.lostluma.dynamic_fps.impl.forge.service; import dynamic_fps.impl.service.ModCompat; +import net.minecraft.client.gui.screens.ReceivingLevelScreen; import net.minecraftforge.fml.ModList; +import java.util.HashSet; +import java.util.Set; + public class ForgeModCompat implements ModCompat { + private static final Set optedInScreens = new HashSet<>(); + private static final Set optedOutScreens = new HashSet<>(); + + static { + optedOutScreens.add(ReceivingLevelScreen.class.getCanonicalName()); + } + @Override public boolean isDisabled() { return false; @@ -13,4 +24,14 @@ public boolean isDisabled() { public boolean disableOverlayOptimization() { return ModList.get().isLoaded("rrls"); } + + @Override + public Set getOptedInScreens() { + return optedInScreens; + } + + @Override + public Set getOptedOutScreens() { + return optedOutScreens; + } } diff --git a/platforms/forge/src/main/resources/META-INF/mods.toml b/platforms/forge/src/main/resources/META-INF/mods.toml index 37437b0f..34aa8a2d 100644 --- a/platforms/forge/src/main/resources/META-INF/mods.toml +++ b/platforms/forge/src/main/resources/META-INF/mods.toml @@ -10,7 +10,7 @@ version = "${version}" displayName = "Dynamic FPS" authors = "juliand665 & LostLuma" description = "Reduce resource usage while Minecraft is in the background or idle." -logoFile = "assets/dynamic_fps/icon.png" +logoFile = "dynamic_fps.png" displayTest = "IGNORE_ALL_VERSION" credits = """ Thanks to: @@ -74,12 +74,12 @@ file="META-INF/accesstransformer.cfg" [[dependencies.dynamic_fps]] modId = "minecraft" mandatory = true -versionRange = "[1.20.0,1.20.4]" +versionRange = "[1.16.5]" ordering = "NONE" side = "CLIENT" [[dependencies.dynamic_fps]] -modId = "cloth_config" +modId = "cloth-config" mandatory = true versionRange = "[1,)" ordering = "NONE" diff --git a/platforms/forge/src/main/resources/dynamic_fps.mixins.json b/platforms/forge/src/main/resources/dynamic_fps.mixins.json index 7a6610bd..5cdc0608 100644 --- a/platforms/forge/src/main/resources/dynamic_fps.mixins.json +++ b/platforms/forge/src/main/resources/dynamic_fps.mixins.json @@ -1,9 +1,11 @@ { "required": true, "package": "net.lostluma.dynamic_fps.impl.forge.mixin", - "compatibilityLevel": "JAVA_21", + "compatibilityLevel": "JAVA_8", "minVersion": "0.8", - "client": [], + "client": [ + "GameRendererMixin" + ], "mixins": [], "server": [], "injectors": { diff --git a/platforms/forge/src/main/resources/dynamic_fps.png b/platforms/forge/src/main/resources/dynamic_fps.png new file mode 100644 index 00000000..f2820519 Binary files /dev/null and b/platforms/forge/src/main/resources/dynamic_fps.png differ diff --git a/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/service/NeoForgeModCompat.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/service/NeoForgeModCompat.java index 80592273..a0c48fd7 100644 --- a/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/service/NeoForgeModCompat.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/service/NeoForgeModCompat.java @@ -1,9 +1,19 @@ package net.lostluma.dynamic_fps.impl.neoforge.service; import dynamic_fps.impl.service.ModCompat; +import net.minecraft.client.gui.screens.ReceivingLevelScreen; import net.neoforged.fml.ModList; +import java.util.HashSet; +import java.util.Set; + public class NeoForgeModCompat implements ModCompat { + private static final Set optedOutScreens = new HashSet<>(); + + static { + optedOutScreens.add(ReceivingLevelScreen.class.getCanonicalName()); + } + @Override public boolean isDisabled() { return false; @@ -13,4 +23,14 @@ public boolean isDisabled() { public boolean disableOverlayOptimization() { return ModList.get().isLoaded("rrls"); } + + @Override + public Set getOptedInScreens() { + return Set.of(); + } + + @Override + public Set getOptedOutScreens() { + return optedOutScreens; + } } diff --git a/platforms/neoforge/src/main/resources/META-INF/mods.toml b/platforms/neoforge/src/main/resources/META-INF/mods.toml index 1c3771b3..2f785c13 100644 --- a/platforms/neoforge/src/main/resources/META-INF/mods.toml +++ b/platforms/neoforge/src/main/resources/META-INF/mods.toml @@ -74,7 +74,7 @@ file="META-INF/accesstransformer.cfg" [[dependencies.dynamic_fps]] modId = "minecraft" mandatory = true -versionRange = "[1.20.0,1.20.4]" +versionRange = "[1.20.2,1.20.4]" ordering = "NONE" side = "CLIENT" diff --git a/platforms/neoforge/src/main/resources/dynamic_fps.mixins.json b/platforms/neoforge/src/main/resources/dynamic_fps.mixins.json index 0f8948a6..859a3186 100644 --- a/platforms/neoforge/src/main/resources/dynamic_fps.mixins.json +++ b/platforms/neoforge/src/main/resources/dynamic_fps.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "net.lostluma.dynamic_fps.impl.neoforge.mixin", - "compatibilityLevel": "JAVA_21", + "compatibilityLevel": "JAVA_8", "minVersion": "0.8", "client": [], "mixins": [], diff --git a/platforms/quilt/src/main/java/net/lostluma/dynamic_fps/impl/quilt/mixin/GuiMixin.java b/platforms/quilt/src/main/java/net/lostluma/dynamic_fps/impl/quilt/mixin/GuiMixin.java index 95139187..aecc8c76 100644 --- a/platforms/quilt/src/main/java/net/lostluma/dynamic_fps/impl/quilt/mixin/GuiMixin.java +++ b/platforms/quilt/src/main/java/net/lostluma/dynamic_fps/impl/quilt/mixin/GuiMixin.java @@ -1,9 +1,9 @@ -package net.lostluma.dynamic_fps.impl.fabric.mixin; +package net.lostluma.dynamic_fps.impl.quilt.mixin; import com.llamalad7.mixinextras.sugar.Local; +import com.mojang.blaze3d.vertex.PoseStack; import dynamic_fps.impl.util.HudInfoRenderer; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiGraphics; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -14,8 +14,14 @@ public class GuiMixin { /** * Render info on whether Dynamic FPS is disabled or always reducing the user's FPS. */ - @Inject(method = "renderSavingIndicator", at = @At("HEAD")) - private void renderSavingIndicator(CallbackInfo callbackInfo, @Local GuiGraphics guiGraphics) { - HudInfoRenderer.renderInfo(guiGraphics); + @Inject( + method = "render", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/gui/Gui;renderSavingIndicator(Lcom/mojang/blaze3d/vertex/PoseStack;)V" + ) + ) + private void render(CallbackInfo callbackInfo, @Local PoseStack poseStack) { + HudInfoRenderer.renderInfo(poseStack); } } diff --git a/platforms/quilt/src/main/java/net/lostluma/dynamic_fps/impl/quilt/service/QuiltModCompat.java b/platforms/quilt/src/main/java/net/lostluma/dynamic_fps/impl/quilt/service/QuiltModCompat.java index 3a11d11d..efc0142b 100644 --- a/platforms/quilt/src/main/java/net/lostluma/dynamic_fps/impl/quilt/service/QuiltModCompat.java +++ b/platforms/quilt/src/main/java/net/lostluma/dynamic_fps/impl/quilt/service/QuiltModCompat.java @@ -15,6 +15,9 @@ public class QuiltModCompat implements ModCompat { private static boolean disableOverlayOptimization = false; + private static final Set optedInScreens = new HashSet<>(); + private static final Set optedOutScreens = new HashSet<>(); + static { QuiltLoader.getAllMods().forEach(QuiltModCompat::parseModMetadata); } @@ -29,6 +32,16 @@ public boolean disableOverlayOptimization() { return disableOverlayOptimization; } + @Override + public Set getOptedInScreens() { + return optedInScreens; + } + + @Override + public Set getOptedOutScreens() { + return optedOutScreens; + } + private static void parseModMetadata(ModContainer mod) { LoaderValue.LObject root; ModMetadata data = mod.metadata(); @@ -40,6 +53,9 @@ private static void parseModMetadata(ModContainer mod) { } parseOverlayOverride(root.get("optimized_overlay")); + + parseScreenOverrides(root.get("optimized_screens"), "enabled", optedInScreens); + parseScreenOverrides(root.get("optimized_screens"), "disabled", optedOutScreens); } private static void parseOverlayOverride(@Nullable LoaderValue value) { @@ -47,4 +63,25 @@ private static void parseOverlayOverride(@Nullable LoaderValue value) { disableOverlayOptimization = true; } } + + private static void parseScreenOverrides(@Nullable LoaderValue parent, String type, Set set) { + if (parent == null || parent.type() != LoaderValue.LType.OBJECT) { + return; + } + + LoaderValue values = parent.asObject().get(type); + + if (values == null || values.type() != LoaderValue.LType.ARRAY) { + return; + } + + MappingResolver resolver = QuiltLoader.getMappingResolver(); + + values.asArray().forEach(value -> { + if (value.type() == LoaderValue.LType.STRING) { + // Translate from intermediary to runtime names for vanilla screens + set.add(resolver.mapClassName("intermediary", value.asString())); + } + }); + } } diff --git a/platforms/quilt/src/main/resources/dynamic_fps.mixins.json b/platforms/quilt/src/main/resources/dynamic_fps.mixins.json index c9b784b3..674a64de 100644 --- a/platforms/quilt/src/main/resources/dynamic_fps.mixins.json +++ b/platforms/quilt/src/main/resources/dynamic_fps.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "net.lostluma.dynamic_fps.impl.quilt.mixin", - "compatibilityLevel": "JAVA_21", + "compatibilityLevel": "JAVA_8", "minVersion": "0.8", "client": [ "GuiMixin", diff --git a/platforms/quilt/src/main/resources/quilt.mod.json b/platforms/quilt/src/main/resources/quilt.mod.json index cfce5469..22613202 100644 --- a/platforms/quilt/src/main/resources/quilt.mod.json +++ b/platforms/quilt/src/main/resources/quilt.mod.json @@ -75,7 +75,7 @@ }, { "id": "minecraft", - "versions": ">=1.20.5-alpha.24.14.a" + "versions": "=1.18.2" }, { "id": "mixinextras", @@ -108,5 +108,41 @@ "dynamic_fps.mixins.json", "dynamic_fps-common.mixins.json" ], - "access_widener": "dynamic_fps.accesswidener" + "access_widener": "dynamic_fps.accesswidener", + "dynamic_fps": { + "optimized_screens": { + "enabled": [ + "net.minecraft.class_4189", + "net.minecraft.class_404", + "net.minecraft.class_426", + "net.minecraft.class_4288", + "net.minecraft.class_6777", + "net.minecraft.class_443", + "net.minecraft.class_446", + "net.minecraft.class_445", + "net.minecraft.class_6599" + ], + "disabled": [ + "net.minecraft.class_434" + ], + "_comment": { + "_0": "Mojang mapping names of the enabled / disabled screens.", + "_1": "Sorted by fully qualified name. Translation not needed for mod screens.", + "enabled": { + "net.minecraft.class_4189": "net.minecraft.client.gui.screens.AccessibilityOptionsScreen", + "net.minecraft.class_404": "net.minecraft.client.gui.screens.ChatOptionsScreen", + "net.minecraft.class_426": "net.minecraft.client.gui.screens.LanguageSelectScreen", + "net.minecraft.class_4288": "net.minecraft.client.gui.screens.MouseSettingsScreen", + "net.minecraft.class_6777": "net.minecraft.client.gui.screens.OnlineOptionsScreen", + "net.minecraft.class_443": "net.minecraft.client.gui.screens.SoundOptionsScreen", + "net.minecraft.class_446": "net.minecraft.client.gui.screens.VideoSettingsScreen", + "net.minecraft.class_445": "net.minecraft.client.gui.screens.WinScreen", + "net.minecraft.class_6599": "net.minecraft.client.gui.screens.controls.KeyBindsScreen" + }, + "disabled": { + "net.minecraft.class_434": "net.minecraft.client.gui.screens.ReceivingLevelScreen" + } + } + } + } } diff --git a/settings.gradle b/settings.gradle index a3537858..50d9539e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,6 +11,6 @@ rootProject.name = "dynamic-fps" include(":platforms:common") include(":platforms:fabric") -// include(":platforms:forge") +include(":platforms:forge") // include(":platforms:neoforge") // include(":platforms:quilt")