-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable and fix up Forge module for 1.21.0
- Loading branch information
Showing
9 changed files
with
60 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
platforms/forge/src/main/java/net/lostluma/dynamic_fps/impl/forge/mixin/GuiMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package net.lostluma.dynamic_fps.impl.forge.mixin; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
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; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(Gui.class) | ||
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(argsOnly = true) GuiGraphics guiGraphics) { | ||
HudInfoRenderer.renderInfo(guiGraphics); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 14 additions & 12 deletions
26
platforms/forge/src/main/resources/dynamic_fps.mixins.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
{ | ||
"required": true, | ||
"package": "net.lostluma.dynamic_fps.impl.forge.mixin", | ||
"minVersion": "0.8", | ||
"client": [], | ||
"mixins": [], | ||
"server": [], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
}, | ||
"overwrites": { | ||
"conformVisibility": true, | ||
"requireAnnotations": true | ||
"required": true, | ||
"package": "net.lostluma.dynamic_fps.impl.forge.mixin", | ||
"minVersion": "0.8", | ||
"client": [ | ||
"GuiMixin" | ||
], | ||
"mixins": [], | ||
"server": [], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
}, | ||
"overwrites": { | ||
"conformVisibility": true, | ||
"requireAnnotations": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters