(World world, float torchFlickerX, int[] lmColors, boolean nightvision)
| 20 | } |
| 21 | |
| 22 | public boolean updateLightmap(World world, float torchFlickerX, int[] lmColors, boolean nightvision) |
| 23 | { |
| 24 | if (this.lightMapRgb == null) |
| 25 | { |
| 26 | return false; |
| 27 | } |
| 28 | else |
| 29 | { |
| 30 | int i = this.lightMapRgb.getHeight(); |
| 31 | |
| 32 | if (nightvision && i < 64) |
| 33 | { |
| 34 | return false; |
| 35 | } |
| 36 | else |
| 37 | { |
| 38 | int j = this.lightMapRgb.getWidth(); |
| 39 | |
| 40 | if (j < 16) |
| 41 | { |
| 42 | warn("Invalid lightmap width: " + j); |
| 43 | this.lightMapRgb = null; |
| 44 | return false; |
| 45 | } |
| 46 | else |
| 47 | { |
| 48 | int k = 0; |
| 49 | |
| 50 | if (nightvision) |
| 51 | { |
| 52 | k = j * 16 * 2; |
| 53 | } |
| 54 | |
| 55 | float f = 1.1666666F * (world.getSunBrightness(1.0F) - 0.2F); |
| 56 | |
| 57 | if (world.getLastLightningBolt() > 0) |
| 58 | { |
| 59 | f = 1.0F; |
| 60 | } |
| 61 | |
| 62 | f = Config.limitTo1(f); |
| 63 | float f1 = f * (float)(j - 1); |
| 64 | float f2 = Config.limitTo1(torchFlickerX + 0.5F) * (float)(j - 1); |
| 65 | float f3 = Config.limitTo1(Config.getGameSettings().saturation); |
| 66 | boolean flag = f3 > 1.0E-4F; |
| 67 | float[][] afloat = this.lightMapRgb.getColorsRgb(); |
| 68 | this.getLightMapColumn(afloat, f1, k, j, this.sunRgbs); |
| 69 | this.getLightMapColumn(afloat, f2, k + 16 * j, j, this.torchRgbs); |
| 70 | float[] afloat1 = new float[3]; |
| 71 | |
| 72 | for (int l = 0; l < 16; ++l) |
| 73 | { |
| 74 | for (int i1 = 0; i1 < 16; ++i1) |
| 75 | { |
| 76 | for (int j1 = 0; j1 < 3; ++j1) |
| 77 | { |
| 78 | float f4 = Config.limitTo1(this.sunRgbs[l][j1] + this.torchRgbs[i1][j1]); |
| 79 |
nothing calls this directly
no test coverage detected