From cf3833e4c447c5a394d8a580cd692715223c46d9 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Sat, 21 Mar 2015 14:11:06 -0400 Subject: [PATCH] Add configuration to toggle fog color and density --- .../java/biomesoplenty/client/fog/FogHandler.java | 11 +++++++++++ .../common/configuration/BOPConfigurationMisc.java | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/java/biomesoplenty/client/fog/FogHandler.java b/src/main/java/biomesoplenty/client/fog/FogHandler.java index 517dd58ab..7e4420293 100644 --- a/src/main/java/biomesoplenty/client/fog/FogHandler.java +++ b/src/main/java/biomesoplenty/client/fog/FogHandler.java @@ -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; diff --git a/src/main/java/biomesoplenty/common/configuration/BOPConfigurationMisc.java b/src/main/java/biomesoplenty/common/configuration/BOPConfigurationMisc.java index fbc6be2fc..ce4e80aed 100644 --- a/src/main/java/biomesoplenty/common/configuration/BOPConfigurationMisc.java +++ b/src/main/java/biomesoplenty/common/configuration/BOPConfigurationMisc.java @@ -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;