-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compatible with forge 1.15.2-31.1.89.
- Loading branch information
1 parent
512ba81
commit 8cc058c
Showing
6 changed files
with
103 additions
and
7 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
51 changes: 51 additions & 0 deletions
51
...ekerzhayard/optiforge/asm/mixins/net/minecraft/client/gui/screen/MixinMainMenuScreen.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,51 @@ | ||
package io.github.zekerzhayard.optiforge.asm.mixins.net.minecraft.client.gui.screen; | ||
|
||
import net.minecraft.client.gui.screen.MainMenuScreen; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import net.minecraft.util.text.ITextComponent; | ||
import net.minecraftforge.client.ForgeHooksClient; | ||
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.Coerce; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(MainMenuScreen.class) | ||
public abstract class MixinMainMenuScreen extends Screen { | ||
@Shadow | ||
private String splashText; | ||
|
||
private MixinMainMenuScreen(ITextComponent titleIn) { | ||
super(titleIn); | ||
} | ||
|
||
@Redirect( | ||
method = "Lnet/minecraft/client/gui/screen/MainMenuScreen;render(IIF)V", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/optifine/reflect/ReflectorMethod;exists()Z", | ||
ordinal = 0, | ||
remap = false | ||
), | ||
require = 1, | ||
allow = 1 | ||
) | ||
private boolean redirect$render$0(@Coerce Object method) { | ||
return true; | ||
} | ||
|
||
@Redirect( | ||
method = "Lnet/minecraft/client/gui/screen/MainMenuScreen;render(IIF)V", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/optifine/reflect/Reflector;callString(Lnet/optifine/reflect/ReflectorMethod;[Ljava/lang/Object;)Ljava/lang/String;", | ||
remap = false | ||
), | ||
require = 1, | ||
allow = 1 | ||
) | ||
private String redirect$render$1(@Coerce Object method, Object[] params) { | ||
ForgeHooksClient.renderMainMenu((MainMenuScreen) params[0], this.font, (int) params[2], (int) params[3]); | ||
return this.splashText; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...zhayard/optiforge/asm/mixins/net/minecraft/client/renderer/texture/MixinAtlasTexture.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,29 @@ | ||
package io.github.zekerzhayard.optiforge.asm.mixins.net.minecraft.client.renderer.texture; | ||
|
||
import java.util.stream.Stream; | ||
|
||
import net.minecraft.client.renderer.texture.AtlasTexture; | ||
import net.minecraft.profiler.IProfiler; | ||
import net.minecraft.resources.IResourceManager; | ||
import net.minecraft.util.ResourceLocation; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
@Mixin(AtlasTexture.class) | ||
public abstract class MixinAtlasTexture { | ||
@ModifyVariable( | ||
method = "Lnet/minecraft/client/renderer/texture/AtlasTexture;stitch(Lnet/minecraft/resources/IResourceManager;Ljava/util/stream/Stream;Lnet/minecraft/profiler/IProfiler;I)Lnet/minecraft/client/renderer/texture/AtlasTexture$SheetData;", | ||
at = @At( | ||
value = "INVOKE_ASSIGN", | ||
target = "Lnet/minecraft/util/math/MathHelper;log2(I)I", | ||
ordinal = 2 | ||
), | ||
index = 14, | ||
require = 1, | ||
allow = 1 | ||
) | ||
private int modifyVariable$stitch$0(int j1, IResourceManager resourceManagerIn, Stream<ResourceLocation> resourceLocationsIn, IProfiler profilerIn, int maxMipmapLevelIn) { | ||
return maxMipmapLevelIn; | ||
} | ||
} |
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