Commit 7670774998a325fb97c8d5188a885980d8ffe7bd
1 parent
3d0296f8
Fix for selecting null shader in MixinEntityRenderer
Showing
1 changed file
with
11 additions
and
1 deletions
src/client/java/com/mumfrey/liteloader/client/mixin/MixinEntityRenderer.java
... | ... | @@ -17,6 +17,7 @@ import com.mumfrey.liteloader.client.overlays.IEntityRenderer; |
17 | 17 | |
18 | 18 | import net.minecraft.client.renderer.EntityRenderer; |
19 | 19 | import net.minecraft.client.renderer.RenderGlobal; |
20 | +import net.minecraft.client.shader.ShaderGroup; | |
20 | 21 | import net.minecraft.util.ResourceLocation; |
21 | 22 | |
22 | 23 | @Mixin(EntityRenderer.class) |
... | ... | @@ -25,6 +26,7 @@ public abstract class MixinEntityRenderer implements IEntityRenderer |
25 | 26 | @Shadow private static ResourceLocation[] SHADERS_TEXTURES; |
26 | 27 | @Shadow private boolean useShader; |
27 | 28 | @Shadow private int shaderIndex; |
29 | + @Shadow private ShaderGroup theShaderGroup; | |
28 | 30 | |
29 | 31 | @Shadow abstract void loadShader(ResourceLocation resourceLocationIn); |
30 | 32 | @Shadow abstract float getFOVModifier(float partialTicks, boolean useFOVSetting); |
... | ... | @@ -162,7 +164,15 @@ public abstract class MixinEntityRenderer implements IEntityRenderer |
162 | 164 | @Override |
163 | 165 | public void selectShader(ResourceLocation shader) |
164 | 166 | { |
165 | - this.loadShader(shader); | |
167 | + if (shader == null) | |
168 | + { | |
169 | + this.theShaderGroup = null; | |
170 | + this.useShader = false; | |
171 | + } | |
172 | + else | |
173 | + { | |
174 | + this.loadShader(shader); | |
175 | + } | |
166 | 176 | } |
167 | 177 | |
168 | 178 | @Override | ... | ... |