diff --git a/src/userdev/java/net/minecraftforge/gradle/userdev/util/DeobfuscatingRepo.java b/src/userdev/java/net/minecraftforge/gradle/userdev/util/DeobfuscatingRepo.java index fde51f5b9..5d77b02e9 100644 --- a/src/userdev/java/net/minecraftforge/gradle/userdev/util/DeobfuscatingRepo.java +++ b/src/userdev/java/net/minecraftforge/gradle/userdev/util/DeobfuscatingRepo.java @@ -130,8 +130,22 @@ private File findRaw(Artifact artifact, String mapping) throws IOException { @Nullable private File findSource(Artifact artifact, String mapping) throws IOException { + // Check if we have previously failed to retrieve sources for the artifact. + // If so, don't attempt the download again. + File noSourceFlag = cache(getArtifactPath(artifact, mapping) + ".nosources"); + if(noSourceFlag.exists()) return null; + File origFile = MavenArtifactDownloader.manual(project, artifact.getDescriptor(), false); - if (origFile == null) return null; + if (origFile == null) { + // Flag that downloading has failed so we don't repeat it + try { + noSourceFlag.getParentFile().mkdirs(); + noSourceFlag.createNewFile(); + } catch(IOException e) { + // Ignore it, not important + } + return null; + } return deobfuscator.deobfSources(origFile, mapping, getArtifactPath(artifact, mapping)); }