Skip to content

Commit

Permalink
Fix NeoForge build
Browse files Browse the repository at this point in the history
  • Loading branch information
LostLuma committed Feb 19, 2024
1 parent 0fe9a0b commit 31776f4
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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"))
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
14 changes: 13 additions & 1 deletion platforms/neoforge/src/main/resources/dynamic_fps.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 31776f4

Please sign in to comment.