()
| 16 | private static NaturalProperties[] propertiesByIndex = new NaturalProperties[0]; |
| 17 | |
| 18 | public static void update() |
| 19 | { |
| 20 | propertiesByIndex = new NaturalProperties[0]; |
| 21 | |
| 22 | if (Config.isNaturalTextures()) |
| 23 | { |
| 24 | String s = "optifine/natural.properties"; |
| 25 | |
| 26 | try |
| 27 | { |
| 28 | ResourceLocation resourcelocation = new ResourceLocation(s); |
| 29 | |
| 30 | if (!Config.hasResource(resourcelocation)) |
| 31 | { |
| 32 | Config.dbg("NaturalTextures: configuration \"" + s + "\" not found"); |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | boolean flag = Config.isFromDefaultResourcePack(resourcelocation); |
| 37 | InputStream inputstream = Config.getResourceStream(resourcelocation); |
| 38 | ArrayList arraylist = new ArrayList(256); |
| 39 | String s1 = Config.readInputStream(inputstream); |
| 40 | inputstream.close(); |
| 41 | String[] astring = Config.tokenize(s1, "\n\r"); |
| 42 | |
| 43 | if (flag) |
| 44 | { |
| 45 | Config.dbg("Natural Textures: Parsing default configuration \"" + s + "\""); |
| 46 | Config.dbg("Natural Textures: Valid only for textures from default resource pack"); |
| 47 | } |
| 48 | else |
| 49 | { |
| 50 | Config.dbg("Natural Textures: Parsing configuration \"" + s + "\""); |
| 51 | } |
| 52 | |
| 53 | TextureMap texturemap = TextureUtils.getTextureMapBlocks(); |
| 54 | |
| 55 | for (int i = 0; i < astring.length; ++i) |
| 56 | { |
| 57 | String s2 = astring[i].trim(); |
| 58 | |
| 59 | if (!s2.startsWith("#")) |
| 60 | { |
| 61 | String[] astring1 = Config.tokenize(s2, "="); |
| 62 | |
| 63 | if (astring1.length != 2) |
| 64 | { |
| 65 | Config.warn("Natural Textures: Invalid \"" + s + "\" line: " + s2); |
| 66 | } |
| 67 | else |
| 68 | { |
| 69 | String s3 = astring1[0].trim(); |
| 70 | String s4 = astring1[1].trim(); |
| 71 | TextureAtlasSprite textureatlassprite = texturemap.getSpriteSafe("minecraft:blocks/" + s3); |
| 72 | |
| 73 | if (textureatlassprite == null) |
| 74 | { |
| 75 | Config.warn("Natural Textures: Texture not found: \"" + s + "\" line: " + s2); |
no test coverage detected