Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incompatibility with RenderLib 1.3.3+ #59

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/main/java/dev/redstudio/valkyrie/mixin/MinecraftMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ private void printCustomF3Shortcuts(final int auxKey, final CallbackInfoReturnab
* @reason Remove the version from the window title and add configurability.
* @author Desoroxxx
*/
@Overwrite
private void createDisplay() throws LWJGLException {
Display.setResizable(true);
Display.setTitle(ValkyrieConfig.general.windowTitle + (FMLLaunchHandler.isDeobfuscatedEnvironment() ? " Development Environment" : ""));

try {
Display.create((new PixelFormat()).withDepthBits(ValkyrieConfig.general.highPrecisionDepthBuffer ? 32 : 24));
} catch (LWJGLException lwjglexception) {
RED_LOGGER.printFramedError("Minecraft Initialization", "Could not set pixel format", "Things relying on depth buffer precision may not work properly", lwjglexception.getMessage());
@ModifyConstant(method = "createDisplay", constant = @Constant(stringValue = "Minecraft 1.12.2"))
private String modifyWindowTitle(String title) {
return ValkyrieConfig.general.windowTitle + (FMLLaunchHandler.isDeobfuscatedEnvironment() ? " Development Environment" : "");
}

Display.create();
}
/**
* @reason Use 32 bit depth buffer if enabled in config.
* @author Desoroxxx
*/
@ModifyConstant(method = "createDisplay", constant = @Constant(intValue = 24))
private int modifyDepthBits(int bits) {
return ValkyrieConfig.general.highPrecisionDepthBuffer ? 32 : 24;
}

/**
Expand Down