Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

Commit

Permalink
smol changes
Browse files Browse the repository at this point in the history
  • Loading branch information
C10udburst committed Aug 30, 2021
1 parent 49b814f commit bb001f6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
10 changes: 9 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-06/schema#",
"type": "object",
"properties": {
"version": {
Expand All @@ -13,6 +13,14 @@
"type": "string",
"description": "Path to .minecraft/mods"
},
"loader": {
"type": "string",
"description": "What mod loader are you using.",
"examples": [
"fabric",
"forge"
]
},
"direct": {
"type": "array",
"items": {
Expand Down
21 changes: 19 additions & 2 deletions updater.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/AntiCope/mod-updater/master/schema.json",
"version": ["1.17.1", "1.17"],
"loader": "fabric",
"path": ".",
"direct": [
{
Expand Down Expand Up @@ -43,21 +44,37 @@
},
{
"name": "resourcepack-opts.jar",
"id": "TiF5QWZY"
"id": "disabled:TiF5QWZY"
},
{
"name": "slyde.jar",
"id": "diCZrsch"
},
{
"name": "seed-mapper.jar",
"id": "C4GbEnuY"
},
{
"name": "fabric-api.jar",
"id": "P7dR8mSH"
}
},
{
"name": "smoothboot.jar",
"id": "FWumhS4T"
},
{
"name": "wthit.jar",
"id": "6AQIaxuO"
}
],
"github_releases": [
{
"name": "clientcommands.jar",
"repo": "Earthcomputer/clientcommands"
},
{
"name": "multiconnect.jar",
"repo": "disabled:Earthcomputer/multiconnect"
}
],
"curseforge": [
Expand Down
12 changes: 10 additions & 2 deletions updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,20 @@ def load_data():

for key in CATEGORY_KEYS+['version']:
if key not in data.keys():
print(f"\033[93mWarn: {key} doesn't exist\033[0m")
print(f"\033[93mWarn: \"{key}\" doesn't exist\033[0m")
data[key] = []

if isinstance(data['version'], str):
data['version'] = [data['version']]

if "loader" not in data.keys():
print(f"\033[93mWarn: \"loader\" doesn't exist\033[0m")
data['loader'] = 'fabric'

if "path" not in data.keys():
print(f"\033[93mWarn: \"path\" doesn't exist\033[0m")
data['path'] = '.'

data['count'] = 0
for key in CATEGORY_KEYS:
data['count'] += len(data[key])
Expand Down Expand Up @@ -107,7 +115,7 @@ def download_modrinth(mod):
r = sort_entries(r, 'date_published')
version = {}
for ver in r:
if set_intersect(data['version'], ver['game_versions']):
if set_intersect(data['version'], ver['game_versions']) and data['loader'] in ver['loaders']:
version = ver
break
if not version:
Expand Down

0 comments on commit bb001f6

Please sign in to comment.