From 31776f4cc30ca3d479748695c016ab15a88f6497 Mon Sep 17 00:00:00 2001 From: LostLuma Date: Mon, 19 Feb 2024 14:40:01 +0100 Subject: [PATCH] Fix NeoForge build --- .../resources/dynamic_fps-common.mixins.json | 14 +--------- .../mixin/DebugScreenOverlayMixin.java | 14 +++++----- .../neoforge}/mixin/GameRendererMixin.java | 10 +++---- .../impl/neoforge}/mixin/GuiMixin.java | 7 +++-- .../neoforge}/mixin/LoadingOverlayMixin.java | 6 ++--- .../impl/neoforge}/mixin/MinecraftMixin.java | 2 +- .../impl/neoforge}/mixin/ScreenMixin.java | 7 +++-- .../neoforge}/mixin/SoundEngineMixin.java | 26 +++++++++---------- .../neoforge}/mixin/StatsScreenMixin.java | 5 ++-- .../neoforge}/mixin/ToastComponentMixin.java | 7 +++-- .../impl/neoforge}/mixin/WindowMixin.java | 8 +++--- .../mixin/bugfix/BlockableEventLoopMixin.java | 5 ++-- .../main/resources/dynamic_fps.mixins.json | 14 +++++++++- settings.gradle | 6 ++--- 14 files changed, 58 insertions(+), 73 deletions(-) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/DebugScreenOverlayMixin.java (96%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/GameRendererMixin.java (95%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/GuiMixin.java (92%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/LoadingOverlayMixin.java (88%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/MinecraftMixin.java (97%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/ScreenMixin.java (96%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/SoundEngineMixin.java (98%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/StatsScreenMixin.java (91%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/ToastComponentMixin.java (92%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/WindowMixin.java (94%) rename platforms/{common/src/main/java/dynamic_fps/impl => neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge}/mixin/bugfix/BlockableEventLoopMixin.java (90%) 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 33486bf4..d1b5414f 100644 --- a/platforms/common/src/main/resources/dynamic_fps-common.mixins.json +++ b/platforms/common/src/main/resources/dynamic_fps-common.mixins.json @@ -3,19 +3,7 @@ "package": "dynamic_fps.impl.mixin", "compatibilityLevel": "JAVA_17", "minVersion": "0.8", - "client": [ - "DebugScreenOverlayMixin", - "GameRendererMixin", - "GuiMixin", - "LoadingOverlayMixin", - "MinecraftMixin", - "ScreenMixin", - "SoundEngineMixin", - "StatsScreenMixin", - "ToastComponentMixin", - "WindowMixin", - "bugfix.BlockableEventLoopMixin" - ], + "client": [], "mixins": [], "server": [], "injectors": { diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/DebugScreenOverlayMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/DebugScreenOverlayMixin.java similarity index 96% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/DebugScreenOverlayMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/DebugScreenOverlayMixin.java index 8c898105..f558ee51 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/DebugScreenOverlayMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/DebugScreenOverlayMixin.java @@ -1,16 +1,14 @@ -package dynamic_fps.impl.mixin; - -import java.util.List; -import java.util.Locale; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; import com.llamalad7.mixinextras.injector.ModifyReturnValue; - import dynamic_fps.impl.DynamicFPSMod; import dynamic_fps.impl.PowerState; import net.minecraft.client.gui.components.DebugScreenOverlay; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import java.util.List; +import java.util.Locale; @Mixin(DebugScreenOverlay.class) public class DebugScreenOverlayMixin { diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/GameRendererMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/GameRendererMixin.java similarity index 95% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/GameRendererMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/GameRendererMixin.java index f21775e7..20cc4b24 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/GameRendererMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/GameRendererMixin.java @@ -1,16 +1,14 @@ -package dynamic_fps.impl.mixin; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import dynamic_fps.impl.DynamicFPSMod; +import net.minecraft.client.renderer.GameRenderer; import org.objectweb.asm.Opcodes; 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 com.llamalad7.mixinextras.injector.ModifyExpressionValue; - -import dynamic_fps.impl.DynamicFPSMod; -import net.minecraft.client.renderer.GameRenderer; - @Mixin(GameRenderer.class) public class GameRendererMixin { /** diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/GuiMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/GuiMixin.java similarity index 92% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/GuiMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/GuiMixin.java index 66af3434..b40123fb 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/GuiMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/GuiMixin.java @@ -1,13 +1,12 @@ -package dynamic_fps.impl.mixin; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; +import dynamic_fps.impl.DynamicFPSMod; +import net.minecraft.client.gui.Gui; 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 dynamic_fps.impl.DynamicFPSMod; -import net.minecraft.client.gui.Gui; - @Mixin(Gui.class) public class GuiMixin { /** diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/LoadingOverlayMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/LoadingOverlayMixin.java similarity index 88% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/LoadingOverlayMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/LoadingOverlayMixin.java index d6b67783..ae6964a3 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/LoadingOverlayMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/LoadingOverlayMixin.java @@ -1,12 +1,10 @@ -package dynamic_fps.impl.mixin; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; +import dynamic_fps.impl.util.duck.DuckLoadingOverlay; import net.minecraft.client.gui.screens.LoadingOverlay; - import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import dynamic_fps.impl.util.duck.DuckLoadingOverlay; - @Mixin(LoadingOverlay.class) public class LoadingOverlayMixin implements DuckLoadingOverlay { @Shadow diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/MinecraftMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/MinecraftMixin.java similarity index 97% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/MinecraftMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/MinecraftMixin.java index ce385c3d..4850ebba 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/MinecraftMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/MinecraftMixin.java @@ -1,4 +1,4 @@ -package dynamic_fps.impl.mixin; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; import com.mojang.blaze3d.platform.Window; import dynamic_fps.impl.DynamicFPSMod; diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/ScreenMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/ScreenMixin.java similarity index 96% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/ScreenMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/ScreenMixin.java index 7f39e351..a081e81a 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/ScreenMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/ScreenMixin.java @@ -1,15 +1,14 @@ -package dynamic_fps.impl.mixin; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; import dynamic_fps.impl.service.ModCompat; +import dynamic_fps.impl.util.duck.DuckScreen; +import net.minecraft.client.gui.screens.Screen; 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 diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/SoundEngineMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/SoundEngineMixin.java similarity index 98% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/SoundEngineMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/SoundEngineMixin.java index 8a68a67f..a6ebd33b 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/SoundEngineMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/SoundEngineMixin.java @@ -1,9 +1,17 @@ -package dynamic_fps.impl.mixin; - -import java.util.Map; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; +import com.llamalad7.mixinextras.injector.ModifyReturnValue; +import com.llamalad7.mixinextras.sugar.Local; +import com.mojang.blaze3d.audio.Listener; +import dynamic_fps.impl.DynamicFPSMod; import dynamic_fps.impl.config.Config; +import dynamic_fps.impl.util.duck.DuckSoundEngine; import net.minecraft.client.Minecraft; +import net.minecraft.client.Options; +import net.minecraft.client.resources.sounds.SoundInstance; +import net.minecraft.client.sounds.ChannelAccess; +import net.minecraft.client.sounds.SoundEngine; +import net.minecraft.sounds.SoundSource; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -13,17 +21,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.llamalad7.mixinextras.injector.ModifyReturnValue; -import com.llamalad7.mixinextras.sugar.Local; -import com.mojang.blaze3d.audio.Listener; - -import dynamic_fps.impl.DynamicFPSMod; -import dynamic_fps.impl.util.duck.DuckSoundEngine; -import net.minecraft.client.Options; -import net.minecraft.client.resources.sounds.SoundInstance; -import net.minecraft.client.sounds.ChannelAccess; -import net.minecraft.client.sounds.SoundEngine; -import net.minecraft.sounds.SoundSource; +import java.util.Map; @Mixin(SoundEngine.class) public class SoundEngineMixin implements DuckSoundEngine { diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/StatsScreenMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/StatsScreenMixin.java similarity index 91% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/StatsScreenMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/StatsScreenMixin.java index 92b1b5ac..1fae1ffb 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/StatsScreenMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/StatsScreenMixin.java @@ -1,13 +1,12 @@ -package dynamic_fps.impl.mixin; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; import dynamic_fps.impl.util.duck.DuckScreen; +import net.minecraft.client.gui.screens.achievement.StatsScreen; 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")) diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/ToastComponentMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/ToastComponentMixin.java similarity index 92% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/ToastComponentMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/ToastComponentMixin.java index 52368925..ae329725 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/ToastComponentMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/ToastComponentMixin.java @@ -1,13 +1,12 @@ -package dynamic_fps.impl.mixin; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; +import dynamic_fps.impl.DynamicFPSMod; +import net.minecraft.client.gui.components.toasts.ToastComponent; 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 dynamic_fps.impl.DynamicFPSMod; -import net.minecraft.client.gui.components.toasts.ToastComponent; - @Mixin(ToastComponent.class) public class ToastComponentMixin { @Inject(method = "freeSlots", at = @At("HEAD"), cancellable = true) diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/WindowMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/WindowMixin.java similarity index 94% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/WindowMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/WindowMixin.java index 3663a496..58f5bdf2 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/WindowMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/WindowMixin.java @@ -1,14 +1,12 @@ -package dynamic_fps.impl.mixin; +package net.lostluma.dynamic_fps.impl.neoforge.mixin; +import com.mojang.blaze3d.platform.Window; +import dynamic_fps.impl.DynamicFPSMod; 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 com.mojang.blaze3d.platform.Window; - -import dynamic_fps.impl.DynamicFPSMod; - @Mixin(Window.class) public class WindowMixin { /** diff --git a/platforms/common/src/main/java/dynamic_fps/impl/mixin/bugfix/BlockableEventLoopMixin.java b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/bugfix/BlockableEventLoopMixin.java similarity index 90% rename from platforms/common/src/main/java/dynamic_fps/impl/mixin/bugfix/BlockableEventLoopMixin.java rename to platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/bugfix/BlockableEventLoopMixin.java index ee2fffcc..010c9084 100644 --- a/platforms/common/src/main/java/dynamic_fps/impl/mixin/bugfix/BlockableEventLoopMixin.java +++ b/platforms/neoforge/src/main/java/net/lostluma/dynamic_fps/impl/neoforge/mixin/bugfix/BlockableEventLoopMixin.java @@ -1,10 +1,9 @@ -package dynamic_fps.impl.mixin.bugfix; +package net.lostluma.dynamic_fps.impl.neoforge.mixin.bugfix; +import net.minecraft.util.thread.BlockableEventLoop; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; -import net.minecraft.util.thread.BlockableEventLoop; - import java.util.concurrent.locks.LockSupport; @Mixin(BlockableEventLoop.class) diff --git a/platforms/neoforge/src/main/resources/dynamic_fps.mixins.json b/platforms/neoforge/src/main/resources/dynamic_fps.mixins.json index a1e30c92..53264eff 100644 --- a/platforms/neoforge/src/main/resources/dynamic_fps.mixins.json +++ b/platforms/neoforge/src/main/resources/dynamic_fps.mixins.json @@ -3,7 +3,19 @@ "package": "net.lostluma.dynamic_fps.impl.neoforge.mixin", "compatibilityLevel": "JAVA_17", "minVersion": "0.8", - "client": [], + "client": [ + "DebugScreenOverlayMixin", + "GameRendererMixin", + "GuiMixin", + "LoadingOverlayMixin", + "MinecraftMixin", + "ScreenMixin", + "SoundEngineMixin", + "StatsScreenMixin", + "ToastComponentMixin", + "WindowMixin", + "bugfix.BlockableEventLoopMixin" + ], "mixins": [], "server": [], "injectors": { diff --git a/settings.gradle b/settings.gradle index 46efda2c..e1062ba1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,7 +10,7 @@ pluginManagement { rootProject.name = "dynamic-fps" include(":platforms:common") -include(":platforms:fabric") -include(":platforms:forge") +// include(":platforms:fabric") +// include(":platforms:forge") include(":platforms:neoforge") -include(":platforms:quilt") +// include(":platforms:quilt")