MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / getSunBrightness

Method getSunBrightness

src/main/java/net/minecraft/world/World.java:1413–1422  ·  view source on GitHub ↗

Returns the sun brightness - checks time of day, rain and thunder

(float p_72971_1_)

Source from the content-addressed store, hash-verified

1411 * Returns the sun brightness - checks time of day, rain and thunder
1412 */
1413 public float getSunBrightness(float p_72971_1_)
1414 {
1415 float f = this.getCelestialAngle(p_72971_1_);
1416 float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.2F);
1417 f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F);
1418 f1 = 1.0F - f1;
1419 f1 = (float)((double)f1 * (1.0D - (double)(this.getRainStrength(p_72971_1_) * 5.0F) / 16.0D));
1420 f1 = (float)((double)f1 * (1.0D - (double)(this.getThunderStrength(p_72971_1_) * 5.0F) / 16.0D));
1421 return f1 * 0.8F + 0.2F;
1422 }
1423
1424 /**
1425 * Calculates the color for the skybox

Callers 2

updateLightmapMethod · 0.95
updateLightmapMethod · 0.80

Calls 5

getCelestialAngleMethod · 0.95
cosMethod · 0.95
clamp_floatMethod · 0.95
getRainStrengthMethod · 0.95
getThunderStrengthMethod · 0.95

Tested by

no test coverage detected