Skip to content

Commit 3cfeb9a

Browse files
authored
Add artifact only if downloads.artifact is not null, fixes mojang versions that don't list main artifact.
1 parent ce929f9 commit 3cfeb9a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/common/java/net/minecraftforge/gradle/common/util/MinecraftRepo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ protected File findPom(String side, String version, File json) throws IOExceptio
217217
VersionJson meta = Utils.loadJson(json, VersionJson.class);
218218
for (VersionJson.Library lib : meta.libraries) {
219219
if (lib.isAllowed()) {
220-
builder.dependencies().add(lib.name, "compile");
220+
if (lib.downloads.artifact != null)
221+
builder.dependencies().add(lib.name, "compile");
221222
if (lib.downloads.classifiers != null) {
222223
if (lib.downloads.classifiers.containsKey("test")) {
223224
builder.dependencies().add(lib.name, "test").withClassifier("test");

src/mcp/java/net/minecraftforge/gradle/mcp/MCPRepo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ private File findPom(String side, String version) throws IOException {
248248
VersionJson meta = Utils.loadJson(json, VersionJson.class);
249249
for (VersionJson.Library lib : meta.libraries) {
250250
if (lib.isAllowed()) {
251-
builder.dependencies().add(lib.name, "compile");
251+
if (lib.downloads.artifact != null)
252+
builder.dependencies().add(lib.name, "compile");
252253
if (lib.downloads.classifiers != null) {
253254
if (lib.downloads.classifiers.containsKey("test")) {
254255
builder.dependencies().add(lib.name, "test").withClassifier("test");

0 commit comments

Comments
 (0)