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,6 +17,7 @@ import com.mumfrey.liteloader.client.overlays.IEntityRenderer; | ||
17 | 17 | ||
18 | import net.minecraft.client.renderer.EntityRenderer; | 18 | import net.minecraft.client.renderer.EntityRenderer; |
19 | import net.minecraft.client.renderer.RenderGlobal; | 19 | import net.minecraft.client.renderer.RenderGlobal; |
20 | +import net.minecraft.client.shader.ShaderGroup; | ||
20 | import net.minecraft.util.ResourceLocation; | 21 | import net.minecraft.util.ResourceLocation; |
21 | 22 | ||
22 | @Mixin(EntityRenderer.class) | 23 | @Mixin(EntityRenderer.class) |
@@ -25,6 +26,7 @@ public abstract class MixinEntityRenderer implements IEntityRenderer | @@ -25,6 +26,7 @@ public abstract class MixinEntityRenderer implements IEntityRenderer | ||
25 | @Shadow private static ResourceLocation[] SHADERS_TEXTURES; | 26 | @Shadow private static ResourceLocation[] SHADERS_TEXTURES; |
26 | @Shadow private boolean useShader; | 27 | @Shadow private boolean useShader; |
27 | @Shadow private int shaderIndex; | 28 | @Shadow private int shaderIndex; |
29 | + @Shadow private ShaderGroup theShaderGroup; | ||
28 | 30 | ||
29 | @Shadow abstract void loadShader(ResourceLocation resourceLocationIn); | 31 | @Shadow abstract void loadShader(ResourceLocation resourceLocationIn); |
30 | @Shadow abstract float getFOVModifier(float partialTicks, boolean useFOVSetting); | 32 | @Shadow abstract float getFOVModifier(float partialTicks, boolean useFOVSetting); |
@@ -162,7 +164,15 @@ public abstract class MixinEntityRenderer implements IEntityRenderer | @@ -162,7 +164,15 @@ public abstract class MixinEntityRenderer implements IEntityRenderer | ||
162 | @Override | 164 | @Override |
163 | public void selectShader(ResourceLocation shader) | 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 | @Override | 178 | @Override |