Automatically disable and re-enable Optifine's Fast Render setting before rendering a video

This commit is contained in:
CrushedPixel
2016-11-28 23:21:20 +01:00
committed by johni0702
parent 1fef12d2bd
commit 030c71c868
5 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package com.replaymod.compat.optifine;
import net.minecraft.client.settings.GameSettings;
import java.lang.reflect.Field;
public class OptifineReflection {
// GameSettings.ofFastRender
public static Field gameSettings_ofFastRender;
static {
try {
// this throws an ignored ClassNotFoundException if Optifine isn't installed
Class.forName("Config");
gameSettings_ofFastRender = GameSettings.class.getDeclaredField("ofFastRender");
gameSettings_ofFastRender.setAccessible(true);
} catch (ClassNotFoundException ignore) {
// no optifine installed
} catch (NoSuchFieldException e) {
// the field wasn't found. Has it been renamed?
e.printStackTrace();
}
}
}