diff options
Diffstat (limited to 'src/main/java/gregtech/common/GT_Client.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_Client.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 494e399762..7d3f687b28 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -9,6 +9,7 @@ import codechicken.lib.vec.Rotation; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -30,6 +31,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.client.event.EntityViewRenderEvent; +import net.minecraftforge.event.terraingen.BiomeEvent; import net.minecraftforge.oredict.OreDictionary; import org.lwjgl.opengl.GL11; @@ -140,6 +143,44 @@ public class GT_Client extends GT_Proxy GL11.glEnd(); GL11.glPopMatrix(); } + + @SubscribeEvent + public void manipulateDensity(EntityViewRenderEvent.FogDensity event) { + if(GT_Pollution.mPlayerPollution > (GT_Mod.gregtechproxy.mPollutionSmogLimit)){ + event.density = (0.15f*(Math.min(GT_Pollution.mPlayerPollution/((float)GT_Mod.gregtechproxy.mPollutionSourRainLimit),1.0f)))+0.1f; + event.setCanceled(true); + } + } + + @SubscribeEvent + public void manipulateColor(EntityViewRenderEvent.FogColors event) { + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.red = 140f/255f; + event.green = 80f/255f; + event.blue = 40f/255f; + } + } + + @SubscribeEvent + public void manipulateGrassColor(BiomeEvent.GetGrassColor event) { + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.newColor = 0xD2691E; + } + } + + @SubscribeEvent + public void manipulateWaterColor(BiomeEvent.GetWaterColor event) { + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.newColor = 0x556B2F; + } + } + + @SubscribeEvent + public void manipulateFoliageColor(BiomeEvent.GetFoliageColor event) { + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.newColor = 0xCD853F; + } + } public boolean isServerSide() { return true; |