diff options
author | Blood-Asp <bloodasphendrik@gmail.com> | 2017-06-14 23:51:39 +0200 |
---|---|---|
committer | Blood-Asp <bloodasphendrik@gmail.com> | 2017-06-14 23:51:39 +0200 |
commit | 911a80752930d6207fc0b850f3ccf8b3da05b0a5 (patch) | |
tree | 76ba0e8245b9e871ea730c6ce7355b55cf88f81a /src/main/java/gregtech/common/GT_Client.java | |
parent | 6b4b32200dce4e3ca2e2813a106a50cb14be38a8 (diff) | |
download | GT5-Unofficial-911a80752930d6207fc0b850f3ccf8b3da05b0a5.tar.gz GT5-Unofficial-911a80752930d6207fc0b850f3ccf8b3da05b0a5.tar.bz2 GT5-Unofficial-911a80752930d6207fc0b850f3ccf8b3da05b0a5.zip |
pollution smog
Diffstat (limited to 'src/main/java/gregtech/common/GT_Client.java')
-rw-r--r-- | src/main/java/gregtech/common/GT_Client.java | 42 |
1 files changed, 42 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..4e255050b7 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,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; |