Skip to content

Commit

Permalink
add xander's patches (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
MicrocontrollersDev authored Apr 18, 2024
1 parent 2fb5057 commit 653f123
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
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);
}
}
1 change: 1 addition & 0 deletions src/main/resources/mixins.patcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"bugfixes.EntityMixin_SprintParticles",
"bugfixes.EntityRendererMixin_AdjustEyeHeightLighting",
"bugfixes.EntityRendererMixin_PolygonOffset",
"bugfixes.EntityRendererMixin_SpectatorShader",
"bugfixes.EntityXPOrbMixin_AdjustHeight",
"bugfixes.FontRendererMixin_ResetStyles",
"bugfixes.GameSettingsMixin_MipmapSlider",
Expand Down

0 comments on commit 653f123

Please sign in to comment.