Switch core to 1.14 (generated via ./gradlew :1.14:setCoreVersion)
This commit is contained in:
@@ -3,11 +3,11 @@ package com.replaymod.compat.optifine;
|
||||
import de.johni0702.minecraft.gui.utils.EventRegistrations;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import com.replaymod.render.events.ReplayRenderCallback;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class DisableFastRender extends EventRegistrations {
|
||||
|
||||
private final Minecraft mc = Minecraft.getInstance();
|
||||
private final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
private boolean wasFastRender = false;
|
||||
|
||||
@@ -16,8 +16,8 @@ public class DisableFastRender extends EventRegistrations {
|
||||
if (!MCVer.hasOptifine()) return;
|
||||
|
||||
try {
|
||||
wasFastRender = (boolean) OptifineReflection.gameSettings_ofFastRender.get(mc.gameSettings);
|
||||
OptifineReflection.gameSettings_ofFastRender.set(mc.gameSettings, false);
|
||||
wasFastRender = (boolean) OptifineReflection.gameSettings_ofFastRender.get(mc.options);
|
||||
OptifineReflection.gameSettings_ofFastRender.set(mc.options, false);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class DisableFastRender extends EventRegistrations {
|
||||
if (!MCVer.hasOptifine()) return;
|
||||
|
||||
try {
|
||||
OptifineReflection.gameSettings_ofFastRender.set(mc.gameSettings, wasFastRender);
|
||||
OptifineReflection.gameSettings_ofFastRender.set(mc.options, wasFastRender);
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.replaymod.compat.optifine;
|
||||
|
||||
import net.minecraft.client.GameSettings;
|
||||
import net.minecraft.client.options.GameOptions;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -15,7 +15,7 @@ public class OptifineReflection {
|
||||
// this throws an ignored ClassNotFoundException if Optifine isn't installed
|
||||
Class.forName("Config");
|
||||
|
||||
gameSettings_ofFastRender = GameSettings.class.getDeclaredField("ofFastRender");
|
||||
gameSettings_ofFastRender = GameOptions.class.getDeclaredField("ofFastRender");
|
||||
gameSettings_ofFastRender.setAccessible(true);
|
||||
} catch (ClassNotFoundException ignore) {
|
||||
// no optifine installed
|
||||
|
||||
Reference in New Issue
Block a user