/*
 * 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;
	}
}

/*
 * 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.compatibility.WMinecraft;
import net.wurstclient.events.listeners.UpdateListener;
import net.wurstclient.features.HelpPage;
import net.wurstclient.features.Mod;
import net.wurstclient.features.SearchTags;
import net.wurstclient.settings.CheckboxSetting;

@SearchTags({"NightVision", "full bright", "brightness", "night vision"})
@HelpPage("Mods/Fullbright")
@Mod.Bypasses
public final class FullbrightMod extends Mod implements UpdateListener
{
	private final CheckboxSetting shaderMode = WMinecraft.OPTIFINE
		? new CheckboxSetting("Shader compatibility mode", false)
		{
			@Override
			public void update()
			{
				if(isActive())
					mc.renderGlobal.loadRenderers();
			}
		} : null;
	
	public FullbrightMod()
	{
		super("Fullbright", "Allows you to see in the dark.");
		wurst.events.add(UpdateListener.class, this);
	}
	
	@Override
	public void initSettings()
	{
		if(shaderMode != null)
			settings.add(shaderMode);
	}
	
	@Override
	public void onEnable()
	{
		if(shaderMode != null && shaderMode.isChecked())
			mc.renderGlobal.loadRenderers();
	}
	
	@Override
	public void onDisable()
	{
		if(shaderMode != null && shaderMode.isChecked())
			mc.renderGlobal.loadRenderers();
		
		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;
	}
	
	public boolean useShaderMode()
	{
		return isActive() && shaderMode != null && shaderMode.isChecked();
	}
}

Add shader compatibility mode