Skip to content

Commit

Permalink
Fix incompatibility with RenderLib 1.3.3+ (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldexun committed Mar 31, 2024
1 parent fa5fd6f commit c1641d8
Showing 1 changed file with 11 additions and 11 deletions.
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

0 comments on commit c1641d8

Please sign in to comment.