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);
}
}
}
}
Aggregations