Automatically disable and re-enable Optifine's Fast Render setting before rendering a video
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user