/*
 * Copyright  2014 - 2017 | Wurst-Imperium | All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package net.wurstclient.features.mods;

import net.wurstclient.events.listeners.UpdateListener;
import net.wurstclient.features.HelpPage;
import net.wurstclient.features.Mod;
import net.wurstclient.features.SearchTags;

@SearchTags({"NightVision", "full bright", "brightness", "night vision"})
@HelpPage("Mods/Fullbright")
@Mod.Bypasses
public final class FullbrightMod extends Mod implements UpdateListener
{
	public FullbrightMod()
	{
		super("Fullbright", "Allows you to see in the dark.");
		wurst.events.add(UpdateListener.class, this);
	}
	
	@Override
	public void onDisable()
	{
		if(wurst.mods.panicMod.isActive())
			mc.gameSettings.gammaSetting = 0.5F;
	}
	
	@Override
	public void onUpdate()
	{
		if(isEnabled() || wurst.mods.xRayMod.isActive())
		{
			if(mc.gameSettings.gammaSetting < 16F)
				mc.gameSettings.gammaSetting += 0.5F;
		}else if(mc.gameSettings.gammaSetting > 0.5F)
			if(mc.gameSettings.gammaSetting < 1F)
				mc.gameSettings.gammaSetting = 0.5F;
			else
				mc.gameSettings.gammaSetting -= 0.5F;
	}
}

@@ -311,16 +311,65 @@
 .mods;%0A%0A
+import net.wurstclient.compatibility.WMinecraft;%0A
 import n
@@ -538,16 +538,65 @@
 rchTags;
+%0Aimport net.wurstclient.settings.CheckboxSetting;
 %0A%0A@Searc
@@ -785,181 +785,748 @@
 %7B%0A%09p
-ublic FullbrightMod()%0A%09%7B%0A%09%09super(%22Fullbright%22, %22Allows you to see in the dark.%22);%0A%09%09wurst.events.add(UpdateListener.class, this);%0A%09%7D%0A%09%0A%09@Override%0A%09public void onDisable()%0A%09%7B
+rivate final CheckboxSetting shaderMode = WMinecraft.OPTIFINE%0A%09%09? new CheckboxSetting(%22Shader compatibility mode%22, false)%0A%09%09%7B%0A%09%09%09@Override%0A%09%09%09public void update()%0A%09%09%09%7B%0A%09%09%09%09if(isActive())%0A%09%09%09%09%09mc.renderGlobal.loadRenderers();%0A%09%09%09%7D%0A%09%09%7D : null;%0A%09%0A%09public FullbrightMod()%0A%09%7B%0A%09%09super(%22Fullbright%22, %22Allows you to see in the dark.%22);%0A%09%09wurst.events.add(UpdateListener.class, this);%0A%09%7D%0A%09%0A%09@Override%0A%09public void initSettings()%0A%09%7B%0A%09%09if(shaderMode != null)%0A%09%09%09settings.add(shaderMode);%0A%09%7D%0A%09%0A%09@Override%0A%09public void onEnable()%0A%09%7B%0A%09%09if(shaderMode != null && shaderMode.isChecked())%0A%09%09%09mc.renderGlobal.loadRenderers();%0A%09%7D%0A%09%0A%09@Override%0A%09public void onDisable()%0A%09%7B%0A%09%09if(shaderMode != null && shaderMode.isChecked())%0A%09%09%09mc.renderGlobal.loadRenderers();%0A%09%09
 %0A%09%09i
@@ -1964,10 +1964,119 @@
 .5F;%0A%09%7D%0A
+%09%0A%09public boolean useShaderMode()%0A%09%7B%0A%09%09return isActive() && shaderMode != null && shaderMode.isChecked();%0A%09%7D%0A
 %7D%0A

Add shader compatibility mode