Skip to content

Commit

Permalink
Fix loading screen hide
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-dencep committed Apr 19, 2024
1 parent ab97852 commit 76fd81b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
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();
}
}
3 changes: 2 additions & 1 deletion common/src/main/resources/rrls-common.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"compat.RendererKeyboardMouseMixin",
"compat.OverlayMixin",
"compat.ServerResourcePackManagerMixin",
"workaround.DrawContentMixin"
"workaround.DrawContentMixin",
"workaround.VertexBufferMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 76fd81b

Please sign in to comment.