Add configuration to toggle fog color and density

This commit is contained in:
Justin Aquadro 2015-03-21 14:11:06 -04:00
parent 9112bb7912
commit cf3833e4c4
2 changed files with 17 additions and 0 deletions

View file

@ -1,5 +1,6 @@
package biomesoplenty.client.fog;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@ -28,6 +29,11 @@ public class FogHandler
@SubscribeEvent
public void onGetFogColour(FogColors event)
{
if (!BOPConfigurationMisc.fogColors)
{
return;
}
if (event.entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)event.entity;
@ -52,6 +58,11 @@ public class FogHandler
@SubscribeEvent
public void onRenderFog(EntityViewRenderEvent.RenderFogEvent event)
{
if (!BOPConfigurationMisc.fogDensity)
{
return;
}
Entity entity = event.entity;
World world = entity.worldObj;

View file

@ -15,6 +15,9 @@ public class BOPConfigurationMisc
public static boolean dungeonLoot;
public static boolean titlePanorama;
public static boolean fogColors;
public static boolean fogDensity;
public static boolean hotSpringsRegeneration;
public static int spawnSearchRadius;
@ -36,6 +39,9 @@ public class BOPConfigurationMisc
//Hard-Coded Colors
skyColors = config.get("Hard-Coded Colors", "Enable Sky Colors", true).getBoolean(false);
fogColors = config.get("Fog Settings", "Enable Fog Colors", true).getBoolean(false);
fogDensity = config.get("Fog Settings", "Enable Fog Density", true).getBoolean(false);
spawnSearchRadius = config.get("Spawn Settings", "Spawn Location Search Radius", 1024, "Must be 256 or higher").getInt();
if (spawnSearchRadius < 256) spawnSearchRadius = 256;