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 bc44095510..e0c06d4140 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -33,6 +33,8 @@ import net.minecraft.stats.StatFileWriter; 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; @@ -148,6 +150,45 @@ public class GT_Client extends GT_Proxy GL11.glEnd(); GL11.glPopMatrix(); } + + @SubscribeEvent + public void manipulateDensity(EntityViewRenderEvent.FogDensity event) { + System.out.println("test: "+GT_Pollution.mPlayerPollution); + if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + event.density = 0.25f/(GT_Pollution.mPlayerPollution/GT_Mod.gregtechproxy.mPollutionSourRainLimit); + 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; |