diff --git a/fml/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch b/fml/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch index d87d49049d..32b152ee1d 100644 --- a/fml/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch +++ b/fml/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -1,11 +1,18 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java -@@ -161,7 +161,8 @@ +@@ -156,12 +156,14 @@ + } + catch (RuntimeException runtimeexception) + { +- field_147635_d.error("Unable to parse metadata from " + resourcelocation1, runtimeexception); ++ //logger.error("Unable to parse metadata from " + resourcelocation1, runtimeexception); ++ cpw.mods.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation1, runtimeexception.getMessage()); + continue; } catch (IOException ioexception1) { - field_147635_d.error("Using missing texture, unable to load " + resourcelocation1, ioexception1); -+// logger.error("Using missing texture, unable to load " + resourcelocation1, ioexception1); ++ //logger.error("Using missing texture, unable to load " + resourcelocation1, ioexception1); + cpw.mods.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation1); continue; } diff --git a/fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java b/fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java index 6a95b73199..13d887a8a1 100644 --- a/fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java +++ b/fml/src/main/java/cpw/mods/fml/client/FMLClientHandler.java @@ -69,13 +69,16 @@ import org.lwjgl.input.Mouse; import com.google.common.base.Strings; import com.google.common.base.Throwables; import com.google.common.collect.BiMap; +import com.google.common.collect.HashBasedTable; import com.google.common.collect.HashBiMap; import com.google.common.collect.HashMultimap; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.SetMultimap; +import com.google.common.collect.Sets; import com.google.common.collect.ImmutableMap.Builder; import com.google.common.collect.Maps; +import com.google.common.collect.Table; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -886,28 +889,44 @@ public class FMLClientHandler implements IFMLSidedHandler } - private static SetMultimap missingTextures = HashMultimap.create(); + private SetMultimap missingTextures = HashMultimap.create(); + private Set badTextureDomains = Sets.newHashSet(); + private Table> brokenTextures = HashBasedTable.create(); + public void trackMissingTexture(ResourceLocation resourceLocation) { + badTextureDomains.add(resourceLocation.getResourceDomain()); missingTextures.put(resourceLocation.getResourceDomain(),resourceLocation); } + public void trackBrokenTexture(ResourceLocation resourceLocation, String error) + { + badTextureDomains.add(resourceLocation.getResourceDomain()); + Set badType = brokenTextures.get(resourceLocation.getResourceDomain(), error); + if (badType == null) + { + badType = Sets.newHashSet(); + brokenTextures.put(resourceLocation.getResourceDomain(), error, badType); + } + badType.add(resourceLocation); + } public void logMissingTextureErrors() { Logger logger = LogManager.getLogger("TEXTURE ERRORS"); logger.error(Strings.repeat("+=", 25)); - logger.error("The following missing textures were found."); + logger.error("The following texture errors were found."); Map resManagers = ObfuscationReflectionHelper.getPrivateValue(SimpleReloadableResourceManager.class, (SimpleReloadableResourceManager)Minecraft.getMinecraft().getResourceManager(), "domainResourceManagers", "field_110548"+"_a"); for (String resourceDomain : missingTextures.keySet()) { Set missing = missingTextures.get(resourceDomain); - logger.error(" DOMAIN {}", resourceDomain); - logger.error(" domain {} is missing {} texture{}",resourceDomain, missing.size(),missing.size()!=1 ? "s" : ""); logger.error(Strings.repeat("=", 50)); + logger.error(" DOMAIN {}", resourceDomain); + logger.error(Strings.repeat("-", 50)); + logger.error(" domain {} is missing {} texture{}",resourceDomain, missing.size(),missing.size()!=1 ? "s" : ""); FallbackResourceManager fallbackResourceManager = resManagers.get(resourceDomain); if (fallbackResourceManager == null) { - logger.error(" domain {} is missing a resource manager, how very odd"); + logger.error(" domain {} is missing a resource manager - it is probably a side-effect of automatic texture processing", resourceDomain); } else { @@ -938,7 +957,26 @@ public class FMLClientHandler implements IFMLSidedHandler { logger.error(" {}",rl.getResourcePath()); } - logger.error(Strings.repeat("-", 50)); + logger.error(Strings.repeat("-", 25)); + if (!brokenTextures.containsRow(resourceDomain)) + { + logger.error(" No other errors exist for domain {}", resourceDomain); + } + else + { + logger.error(" The following other errors were reported for domain {}:",resourceDomain); + Map> resourceErrs = brokenTextures.row(resourceDomain); + for (String error: resourceErrs.keySet()) + { + logger.error(Strings.repeat("-", 25)); + logger.error(" Problem: {}", error); + for (ResourceLocation rl : resourceErrs.get(error)) + { + logger.error(" {}",rl.getResourcePath()); + } + } + } + logger.error(Strings.repeat("=", 50)); } logger.error(Strings.repeat("+=", 25)); }