Search in sources :

Example 1 with ChainingSkyRenderer

use of hellfirepvp.astralsorcery.client.sky.ChainingSkyRenderer in project AstralSorcery by HellFirePvP.

the class SkyRenderEventHandler method onFog.

public static void onFog(EntityViewRenderEvent.FogColors event) {
    ClientWorld world = Minecraft.getInstance().world;
    if (world != null) {
        String strDimKey = world.getDimensionKey().getLocation().toString();
        if (world.func_239132_a_().func_241683_c_() == DimensionRenderInfo.FogType.NORMAL && RenderingConfig.CONFIG.dimensionsWithSkyRendering.get().contains(strDimKey) && !RenderingConfig.CONFIG.dimensionsWithOnlyConstellationRendering.get().contains(strDimKey) && world.func_239132_a_().getSkyRenderHandler() instanceof ChainingSkyRenderer) {
            WorldContext ctx = SkyHandler.getContext(world, LogicalSide.CLIENT);
            if (ctx != null && ctx.getCelestialEventHandler().getSolarEclipse().isActiveNow()) {
                float perc = ctx.getCelestialEventHandler().getSolarEclipsePercent();
                perc = 0.05F + (perc * 0.95F);
                event.setRed(event.getRed() * perc);
                event.setGreen(event.getGreen() * perc);
                event.setBlue(event.getBlue() * perc);
            }
        }
    }
}
Also used : ClientWorld(net.minecraft.client.world.ClientWorld) WorldContext(hellfirepvp.astralsorcery.common.constellation.world.WorldContext) ChainingSkyRenderer(hellfirepvp.astralsorcery.client.sky.ChainingSkyRenderer)

Aggregations

ChainingSkyRenderer (hellfirepvp.astralsorcery.client.sky.ChainingSkyRenderer)1 WorldContext (hellfirepvp.astralsorcery.common.constellation.world.WorldContext)1 ClientWorld (net.minecraft.client.world.ClientWorld)1