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 2445569 commit d71d009
Showing 1 changed file with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import at.feldim2425.moreoverlays.api.lightoverlay.ILightScanner;
import at.feldim2425.moreoverlays.api.lightoverlay.LightOverlayReloadHandlerEvent;
import at.feldim2425.moreoverlays.config.Config;
import net.minecraft.client.GameSettings;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.event.RenderWorldLastEvent;
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){
GameSettings settings = Minecraft.getInstance().gameSettings;
if(enabled){
setBobbing = settings.viewBobbing;
settings.viewBobbing = false;
} else{
settings.viewBobbing = setBobbing;
}
}
}

public static void reloadHandler() {
Expand Down Expand Up @@ -109,15 +93,4 @@ public void onClientTick(TickEvent.ClientTickEvent event) {
}

}

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 d71d009

Please sign in to comment.