(String path)
| 129 | } |
| 130 | |
| 131 | public boolean isValid(String path) |
| 132 | { |
| 133 | if (this.textures != null && this.textures.length != 0) |
| 134 | { |
| 135 | if (this.resourceLocations != null) |
| 136 | { |
| 137 | return true; |
| 138 | } |
| 139 | else |
| 140 | { |
| 141 | this.resourceLocations = new ResourceLocation[this.textures.length]; |
| 142 | boolean flag = this.pathProps.startsWith("mcpatcher/mob/"); |
| 143 | ResourceLocation resourcelocation = RandomEntities.getLocationRandom(this.baseResLoc, flag); |
| 144 | |
| 145 | if (resourcelocation == null) |
| 146 | { |
| 147 | Config.warn("Invalid path: " + this.baseResLoc.getResourcePath()); |
| 148 | return false; |
| 149 | } |
| 150 | else |
| 151 | { |
| 152 | for (int i = 0; i < this.resourceLocations.length; ++i) |
| 153 | { |
| 154 | int j = this.textures[i]; |
| 155 | |
| 156 | if (j <= 1) |
| 157 | { |
| 158 | this.resourceLocations[i] = this.baseResLoc; |
| 159 | } |
| 160 | else |
| 161 | { |
| 162 | ResourceLocation resourcelocation1 = RandomEntities.getLocationIndexed(resourcelocation, j); |
| 163 | |
| 164 | if (resourcelocation1 == null) |
| 165 | { |
| 166 | Config.warn("Invalid path: " + this.baseResLoc.getResourcePath()); |
| 167 | return false; |
| 168 | } |
| 169 | |
| 170 | if (!Config.hasResource(resourcelocation1)) |
| 171 | { |
| 172 | Config.warn("Texture not found: " + resourcelocation1.getResourcePath()); |
| 173 | return false; |
| 174 | } |
| 175 | |
| 176 | this.resourceLocations[i] = resourcelocation1; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | if (this.weights != null) |
| 181 | { |
| 182 | if (this.weights.length > this.resourceLocations.length) |
| 183 | { |
| 184 | Config.warn("More weights defined than skins, trimming weights: " + path); |
| 185 | int[] aint = new int[this.resourceLocations.length]; |
| 186 | System.arraycopy(this.weights, 0, aint, 0, aint.length); |
| 187 | this.weights = aint; |
| 188 | } |
no test coverage detected