forked from Sk1erLLC/Patcher
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fb5057
commit 653f123
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityRendererMixin_SpectatorShader.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 club.sk1er.patcher.mixins.bugfixes; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.renderer.EntityRenderer; | ||
import net.minecraft.util.ResourceLocation; | ||
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.Redirect; | ||
|
||
@Mixin(EntityRenderer.class) | ||
public abstract class EntityRendererMixin_SpectatorShader { | ||
@Shadow | ||
private Minecraft mc; | ||
|
||
@Shadow | ||
public abstract void loadShader(ResourceLocation resourceLocationIn); | ||
|
||
@Redirect( | ||
method = "loadEntityShader", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/renderer/EntityRenderer;loadShader(Lnet/minecraft/util/ResourceLocation;)V" | ||
) | ||
) | ||
public void patcher$fixSpectatorShader(EntityRenderer entityRenderer, ResourceLocation resourceLocationIn) { | ||
if (mc.gameSettings.thirdPersonView == 0) loadShader(resourceLocationIn); | ||
} | ||
} |
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