-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cf: added support for individual mod/plugin files (#277)
- Loading branch information
Showing
29 changed files
with
1,046 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 23 additions & 4 deletions
27
src/main/java/me/itzg/helpers/curseforge/CategoryInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
package me.itzg.helpers.curseforge; | ||
|
||
import java.util.Map; | ||
import lombok.AllArgsConstructor; | ||
import me.itzg.helpers.curseforge.model.Category; | ||
|
||
import java.util.Map; | ||
|
||
@AllArgsConstructor | ||
class CategoryInfo { | ||
public class CategoryInfo { | ||
Map<Integer, Category> contentClassIds; | ||
int modpackClassId; | ||
Map<String, Integer> slugIds; | ||
|
||
public int getClassIdForSlug(String categorySlug) { | ||
final Integer classId = slugIds.get(categorySlug); | ||
if (classId != null) { | ||
return classId; | ||
} | ||
else { | ||
throw new IllegalArgumentException("Unexpected category: " + categorySlug); | ||
} | ||
} | ||
|
||
public Category getCategory(int categoryId) { | ||
final Category category = contentClassIds.get(categoryId); | ||
if (category != null) { | ||
return category; | ||
} | ||
else { | ||
throw new IllegalArgumentException("Unknown category ID: " + categoryId); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.