Skip to content

Commit

Permalink
Enabled view bobbing again for optifine
Browse files Browse the repository at this point in the history
  • Loading branch information
r8420 committed Dec 9, 2021
1 parent bcd01f4 commit f06c690
Showing 1 changed file with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import at.ridgo8.moreoverlays.api.lightoverlay.ILightScanner;
import at.ridgo8.moreoverlays.api.lightoverlay.LightOverlayReloadHandlerEvent;
import at.ridgo8.moreoverlays.config.Config;
import net.minecraft.client.Options;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.event.RenderLevelLastEvent;
import net.minecraftforge.common.MinecraftForge;
Expand All @@ -16,12 +15,9 @@

public class LightOverlayHandler {

private static boolean OPTIFINE = false;
private static boolean enabled = false;
private static ILightRenderer renderer = null;
private static ILightScanner scanner = null;
private static boolean OptifineCheckDone;
private static boolean setBobbing = false;

public static void init() {
MinecraftForge.EVENT_BUS.register(new LightOverlayHandler());
Expand All @@ -42,18 +38,6 @@ public static void setEnabled(boolean enabled) {
scanner.clear();
}
LightOverlayHandler.enabled = enabled;
if(!OptifineCheckDone){
detectOptifine();
}
if(OPTIFINE){
Options settings = Minecraft.getInstance().options;
if(enabled){
setBobbing = settings.bobView;
settings.bobView = false;
} else{
settings.bobView = setBobbing;
}
}
}

public static void reloadHandler() {
Expand Down Expand Up @@ -107,17 +91,5 @@ public void onClientTick(TickEvent.ClientTickEvent event) {
(Minecraft.getInstance().screen == null || !Minecraft.getInstance().screen.isPauseScreen())) {
scanner.update(Minecraft.getInstance().player);
}

}

private static void detectOptifine(){
try {
Class.forName("optifine.ZipResourceProvider");
OPTIFINE = true;
OptifineCheckDone = true;
} catch (final ClassNotFoundException e) {
OPTIFINE = false;
OptifineCheckDone = true;
}
}
}

0 comments on commit f06c690

Please sign in to comment.