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

Method getCloudColour

src/main/java/net/minecraft/world/World.java:1515–1549  ·  view source on GitHub ↗
(float partialTicks)

Source from the content-addressed store, hash-verified

1513 }
1514
1515 public Vec3 getCloudColour(float partialTicks)
1516 {
1517 float f = this.getCelestialAngle(partialTicks);
1518 float f1 = MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
1519 f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F);
1520 float f2 = (float)(this.cloudColour >> 16 & 255L) / 255.0F;
1521 float f3 = (float)(this.cloudColour >> 8 & 255L) / 255.0F;
1522 float f4 = (float)(this.cloudColour & 255L) / 255.0F;
1523 float f5 = this.getRainStrength(partialTicks);
1524
1525 if (f5 > 0.0F)
1526 {
1527 float f6 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.6F;
1528 float f7 = 1.0F - f5 * 0.95F;
1529 f2 = f2 * f7 + f6 * (1.0F - f7);
1530 f3 = f3 * f7 + f6 * (1.0F - f7);
1531 f4 = f4 * f7 + f6 * (1.0F - f7);
1532 }
1533
1534 f2 = f2 * (f1 * 0.9F + 0.1F);
1535 f3 = f3 * (f1 * 0.9F + 0.1F);
1536 f4 = f4 * (f1 * 0.85F + 0.15F);
1537 float f9 = this.getThunderStrength(partialTicks);
1538
1539 if (f9 > 0.0F)
1540 {
1541 float f10 = (f2 * 0.3F + f3 * 0.59F + f4 * 0.11F) * 0.2F;
1542 float f8 = 1.0F - f9 * 0.95F;
1543 f2 = f2 * f8 + f10 * (1.0F - f8);
1544 f3 = f3 * f8 + f10 * (1.0F - f8);
1545 f4 = f4 * f8 + f10 * (1.0F - f8);
1546 }
1547
1548 return new Vec3(f2, f3, f4);
1549 }
1550
1551 /**
1552 * Returns vector(ish) with R/G/B for fog

Callers 3

updateFogColorMethod · 0.95
renderCloudsMethod · 0.80
renderCloudsFancyMethod · 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