Skip to content

Commit dcaf2ef

Browse files
committed
[2.5.1] 1.21.5 Support
1 parent be9b65e commit dcaf2ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

headlessmc-lwjgl/src/main/java/me/earth/headlessmc/lwjgl/redirections/LwjglRedirections.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// TODO: redirect Keyboard and Mouse?
1616
@UtilityClass
1717
public class LwjglRedirections {
18+
public static final int GL_TEXTURE_WIDTH = 4096;
1819
public static final int GL_TEXTURE_INTERNAL_FORMAT_CONST = 4099;
1920
public static final int GL_TEXTURE_INTERNAL_FORMAT = Integer.parseInt(
2021
System.getProperty(LwjglProperties.GL_TEXTURE_INTERNAL_FORMAT, "32856")); //RGBA8
@@ -119,6 +120,8 @@ public static void register(RedirectionManager manager) {
119120
// Couldn't find a matching vanilla TextureFormat for OpenGL internal format id
120121
// com.mojang.blaze3d.opengl.GlDevice
121122
return GL_TEXTURE_INTERNAL_FORMAT;
123+
} else if ((int) args[2] == GL_TEXTURE_WIDTH && (int) args[1]/*level*/ > 0) {
124+
return 0; // otherwise Neoforge 1.21.5 gets caught in an endless loop of checking width != 0; for higher levels
122125
}
123126

124127
return TEXTURE_SIZE;

0 commit comments

Comments
 (0)