(GameSettings settings, World world)
| 16 | public 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) |
no test coverage detected