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

Method updateLightmap

src/main/java/net/optifine/LightMapPack.java:33–101  ·  view source on GitHub ↗
(World world, float torchFlickerX, int[] lmColors, boolean nightvision, float partialTicks)

Source from the content-addressed store, hash-verified

31 }
32
33 public boolean updateLightmap(World world, float torchFlickerX, int[] lmColors, boolean nightvision, float partialTicks)
34 {
35 if (this.lightMapRain == null && this.lightMapThunder == null)
36 {
37 return this.lightMap.updateLightmap(world, torchFlickerX, lmColors, nightvision);
38 }
39 else
40 {
41 int i = world.provider.getDimensionId();
42
43 if (i != 1 && i != -1)
44 {
45 float f = world.getRainStrength(partialTicks);
46 float f1 = world.getThunderStrength(partialTicks);
47 float f2 = 1.0E-4F;
48 boolean flag = f > f2;
49 boolean flag1 = f1 > f2;
50
51 if (!flag && !flag1)
52 {
53 return this.lightMap.updateLightmap(world, torchFlickerX, lmColors, nightvision);
54 }
55 else
56 {
57 if (f > 0.0F)
58 {
59 f1 /= f;
60 }
61
62 float f3 = 1.0F - f;
63 float f4 = f - f1;
64
65 if (this.colorBuffer1.length != lmColors.length)
66 {
67 this.colorBuffer1 = new int[lmColors.length];
68 this.colorBuffer2 = new int[lmColors.length];
69 }
70
71 int j = 0;
72 int[][] aint = new int[][] {lmColors, this.colorBuffer1, this.colorBuffer2};
73 float[] afloat = new float[3];
74
75 if (f3 > f2 && this.lightMap.updateLightmap(world, torchFlickerX, aint[j], nightvision))
76 {
77 afloat[j] = f3;
78 ++j;
79 }
80
81 if (f4 > f2 && this.lightMapRain != null && this.lightMapRain.updateLightmap(world, torchFlickerX, aint[j], nightvision))
82 {
83 afloat[j] = f4;
84 ++j;
85 }
86
87 if (f1 > f2 && this.lightMapThunder != null && this.lightMapThunder.updateLightmap(world, torchFlickerX, aint[j], nightvision))
88 {
89 afloat[j] = f1;
90 ++j;

Callers 1

updateLightmapMethod · 0.95

Calls 4

blendMethod · 0.95
getRainStrengthMethod · 0.80
getThunderStrengthMethod · 0.80
getDimensionIdMethod · 0.45

Tested by

no test coverage detected