-
Notifications
You must be signed in to change notification settings - Fork 13
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
ab97852
commit 76fd81b
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...on/src/main/java/com/github/dimadencep/mods/rrls/mixins/workaround/VertexBufferMixin.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,34 @@ | ||
/* | ||
* Copyright 2023 - 2024 dima_dencep. | ||
* | ||
* Licensed under the Open Software License, Version 3.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* | ||
* You may obtain a copy of the License at | ||
* https://spdx.org/licenses/OSL-3.0.txt | ||
*/ | ||
|
||
package com.github.dimadencep.mods.rrls.mixins.workaround; | ||
|
||
import net.minecraft.client.gl.ShaderProgram; | ||
import net.minecraft.client.gl.VertexBuffer; | ||
import org.joml.Matrix4f; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(VertexBuffer.class) | ||
public class VertexBufferMixin { | ||
@Inject( | ||
method = "drawInternal", | ||
at = @At( | ||
value = "HEAD" | ||
), | ||
cancellable = true | ||
) | ||
public void rrls$workaroundNullShader(Matrix4f viewMatrix, Matrix4f projectionMatrix, ShaderProgram program, CallbackInfo ci) { | ||
if (program == null) | ||
ci.cancel(); | ||
} | ||
} |
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