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

Method updateWaterOpacity

src/main/java/net/optifine/ClearWater.java:18–108  ·  view source on GitHub ↗
(GameSettings settings, World world)

Source from the content-addressed store, hash-verified

16public class ClearWater
17{
18 public static void updateWaterOpacity(GameSettings settings, World world)
19 {
20 if (settings != null)
21 {
22 int i = 3;
23
24 if (settings.ofClearWater)
25 {
26 i = 1;
27 }
28
29 BlockAir.setLightOpacity(Blocks.water, i);
30 BlockAir.setLightOpacity(Blocks.flowing_water, i);
31 }
32
33 if (world != null)
34 {
35 IChunkProvider ichunkprovider = world.getChunkProvider();
36
37 if (ichunkprovider != null)
38 {
39 Entity entity = Config.getMinecraft().getRenderViewEntity();
40
41 if (entity != null)
42 {
43 int j = (int)entity.posX / 16;
44 int k = (int)entity.posZ / 16;
45 int l = j - 512;
46 int i1 = j + 512;
47 int j1 = k - 512;
48 int k1 = k + 512;
49 int l1 = 0;
50
51 for (int i2 = l; i2 < i1; ++i2)
52 {
53 for (int j2 = j1; j2 < k1; ++j2)
54 {
55 if (ichunkprovider.chunkExists(i2, j2))
56 {
57 Chunk chunk = ichunkprovider.provideChunk(i2, j2);
58
59 if (chunk != null && !(chunk instanceof EmptyChunk))
60 {
61 int k2 = i2 << 4;
62 int l2 = j2 << 4;
63 int i3 = k2 + 16;
64 int j3 = l2 + 16;
65 BlockPosM blockposm = new BlockPosM(0, 0, 0);
66 BlockPosM blockposm1 = new BlockPosM(0, 0, 0);
67
68 for (int k3 = k2; k3 < i3; ++k3)
69 {
70 for (int l3 = l2; l3 < j3; ++l3)
71 {
72 blockposm.setXyz(k3, 0, l3);
73 BlockPos blockpos = world.getPrecipitationHeight(blockposm);
74
75 for (int i4 = 0; i4 < blockpos.getY(); ++i4)

Callers 2

updateWaterOpacityMethod · 0.95
onTickMethod · 0.95

Calls 15

setLightOpacityMethod · 0.95
getMinecraftMethod · 0.95
chunkExistsMethod · 0.95
provideChunkMethod · 0.95
setXyzMethod · 0.95
getBlockMethod · 0.95
getYMethod · 0.95
isMinecraftThreadMethod · 0.95
dbgMethod · 0.95
getChunkProviderMethod · 0.80
getRenderViewEntityMethod · 0.80

Tested by

no test coverage detected