Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Commit 6bba5e5

Browse files
committed
Fix injection point for RenderScreenEvent
Old injection point caused the event to potentially be called after the shader identity was setup, which would result in unexpected render outputs.
1 parent 1c9fc01 commit 6bba5e5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/main/java/clientapi/load/mixin/MixinEntityRenderer.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import static net.minecraft.block.material.Material.AIR;
3535
import static net.minecraft.block.material.Material.WATER;
36+
import static org.spongepowered.asm.lib.Opcodes.GETFIELD;
3637

3738
/**
3839
* @author Brady
@@ -44,10 +45,10 @@ public class MixinEntityRenderer {
4445
@Inject(
4546
method = "updateCameraAndRender",
4647
at = @At(
47-
value = "INVOKE_STRING",
48-
target = "net/minecraft/profiler/Profiler.endStartSection(Ljava/lang/String;)V",
49-
args = { "ldc=gui" }
50-
)
48+
value = "FIELD",
49+
opcode = GETFIELD,
50+
target = "net/minecraft/client/renderer/OpenGlHelper.shadersSupported:Z"
51+
)
5152
)
5253
private void updateCameraAndRender(float partialTicks, long nanoTime, CallbackInfo ci) {
5354
ClientAPI.EVENT_BUS.post(new RenderScreenEvent(partialTicks));
@@ -58,8 +59,8 @@ private void updateCameraAndRender(float partialTicks, long nanoTime, CallbackIn
5859
at = @At(
5960
value = "INVOKE_STRING",
6061
target = "net/minecraft/profiler/Profiler.endStartSection(Ljava/lang/String;)V",
61-
args = { "ldc=hand" }
62-
)
62+
args = "ldc=hand"
63+
)
6364
)
6465
private void onStartHand(int pass, float partialTicks, long finishTimeNano, CallbackInfo ci) {
6566
ClientAPI.EVENT_BUS.post(new RenderWorldEvent(partialTicks, pass));

0 commit comments

Comments
 (0)