Skip to content

Commit 461296f

Browse files
authored
Merge pull request #9 from mcmod-info-mirror/main
2 parents 6ab1c4a + d3ed661 commit 461296f

24 files changed

+448
-478
lines changed

.github/workflows/tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Unit Test
2+
3+
on:
4+
push:
5+
# branches: [main]
6+
pull_request:
7+
merge_group:
8+
workflow_dispatch:
9+
10+
jobs:
11+
unit-test:
12+
runs-on: ubuntu-latest
13+
name: Unit test
14+
env:
15+
CONFIG: ${{ secrets.CONFIG }} # 配置文件
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Install python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: 3.11
26+
27+
- name: Install just
28+
uses: extractions/setup-just@v2
29+
30+
- name: Start Redis
31+
uses: supercharge/[email protected]
32+
33+
- name: Start MongoDB
34+
uses: supercharge/[email protected]
35+
36+
- name: Install dependencies
37+
run: |
38+
just mongodb-tool-install
39+
just redis-tool-install
40+
just ci-install
41+
just import-data
42+
just ci-config
43+
44+
- name: Run unit tests
45+
run: |
46+
just ci-test

config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ConfigModel(BaseModel):
4444
curseforge_api: str = "https://api.curseforge.com" # 不然和api的拼接对不上
4545
modrinth_api: str = "https://api.modrinth.com/v2"
4646
telegram_bot: bool = False
47-
bot_api: str = "<bot api>"
47+
bot_api: str = "https://api.telegram.org/bot"
4848
bot_token: str = "<bot token>"
4949
chat_id: str = "<chat id>"
5050
telegram_proxy: Optional[str] = None

data/curseforge_files.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

data/curseforge_fingerprints.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

data/curseforge_mods.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

data/modrinth_files.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

data/modrinth_projects.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"_id":"Wnxd13zP","additional_categories":[],"approved":"2023-06-09T23:48:35.117961Z","body":"Clumps groups XP orbs together into a single entity to reduce lag when there are many in a small area. On top of this, it also makes the player immediately collect the orbs once they touch the player, so you are not stuck with a bunch of orbs in your face.\n\n### Do I have to install it client or server side?\n* For **1.17 or newer versions** it is only required on **server side**.\n* For **older Minecraft versions** you have to install it on **both sides**.\n\nIf you would like to support me in my modding endeavors, you can become a patron via **[![Patreon logo](https://i.imgur.com/CAJuExT.png) Patreon](https://www.patreon.com/jaredlll08)**.\n\n[![Nodecraft sponsor banner](https://assets.blamejared.com/nodecraft/jared.jpg)](https://nodecraft.com/r/jared)\n\n**This project is sponsored by Nodecraft. Use code [JARED](https://nodecraft.com/r/jared) for 30% off your first month of service!**","body_url":null,"categories":["storage","utility"],"client_side":"required","color":12368900,"description":"Clumps XP orbs together to reduce lag","discord_url":null,"donation_urls":[{"id":"patreon","platform":"Patreon","url":"https://www.patreon.com/jaredlll08"}],"downloads":5509502,"followers":2091,"found":true,"gallery":[],"game_versions":["1.10.2","1.11.2","1.12","1.12.1","1.12.2","1.14.3","1.14.4","1.15.2","1.16.1","1.16.2","1.16.3","1.16.4","1.16.5","1.17","1.17.1-pre1","1.17.1-rc2","1.17.1","21w37a","1.18","1.18.1","1.18.2","1.19","1.19.1","1.19.2","1.19.3","1.19.4","1.20","1.20.1","1.20.2","1.20.3","1.20.4","1.20.5","1.20.6","1.21","1.21.1","1.21.2","1.21.3","1.21.4"],"icon_url":"https://cdn.modrinth.com/data/Wnxd13zP/6a965bb7974c3e759a53a1c89c35de4acd4cf86a_96.webp","issues_url":"https://github.com/jaredlll08/Clumps/issues","license":{"id":"MIT","name":"MIT License","url":null},"loaders":["fabric","forge","neoforge"],"moderator_message":null,"monetization_status":"monetized","project_type":"mod","published":{"$date":"2023-06-04T08:54:48.176Z"},"queued":{"$date":"2023-06-04T08:54:48.176Z"},"requested_status":"approved","server_side":"required","slug":"clumps","source_url":"https://github.com/jaredlll08/Clumps","status":"approved","sync_at":"2025-01-07T15:28:18Z","team":"twbRaNO5","thread_id":"Wnxd13zP","title":"Clumps","translated_description":"Clumps 提高了玩家的物品数量,从而减少了延迟。","updated":"2024-12-22T23:43:39.322218Z","versions":["9hlctcDE","2PT9pbRj","HWb4PbLd","YlKKvqsg","k8jlVbEc","gGoDFlua","gLaYxa4s","6fWV0xJt","WUfSMmN9","nZvGITpT","YBmchP0h","xVBjqLw6","8jfhokYb","fTWVa6NX","Km2A7nLe","2MDA8v5I","A8fHbFS6","D4jsjhXA","ihiDVwNa","F8pfwrMz","W9FnDe1l","aqIk2Edw","xGvjcE7h","HT5eROlq","KBjSLpWi","k0Jwkd3m","BLPxOCPb","14gDpVDM","At7EuPwE","ZG68IYMG","gKfIS5UE","CK3gP3au","ABZ5Czfa","gjSDwzYc","60tArTRZ","Ge8WfKwm","a4YkXTss","qMEjJ46Z","iKpD3bu5","v6nZL7ij","kX922wv5","QfW5PBK0","QqCGODhN","DeVfca9r","bXpU2lu9","Y3KgUihY","c5XwSPGO","LTLe60ZJ","dMXKxndc","qgAkNod5","iCqS0XV6","rcImocgP","ghtGew4o","JKr8b0On","THJnSpxM","WEPinRvr","cB8mFWgx","nZ5nhrKv","C52dmdfZ","4oD9zKPV","qE3ikVnU","3AH29I4c","pug6aepS","aogHNv3y","2ogOQExk","QdyDo2La","3H5r9v4h","EAjgpiKA","UutzgwbZ","QkUVbfJV","qy5gqUCM","BxGXjwSg","gRpWIMha","l4IskRR5","xJwCqvzt","oasiVUpa","ssnANiog","JJ8S77j7","dcOL77zc","lI1Rscqr","nLgUCki4","pePFYnZ8","yPvrslL3","eKxVcvwX","ptOjPKUD","nuz7LOld","JGu6BDFO","r69CWcGO","sh7X4I2y","2WUro9Vp","Hrt4D2se","hnxzDUav","UmFe4S0c","SYSnPECv","MkMRGkr6","1FT90X9E","Ke4qgpLt","uGVtPl4l","zkCCKRNT","oH2kHLZT","oTaQQP72","nvpGk3Xn","HkwE1Hla","N40QLcL8","jpwxpMB1","7mmSmyfc","wb2m4G4N","BcqP4XTU","FRktsfso","4h8s4N4m","UId1Oi4e","KYNXYqwG","MKiINIqy","N1HpDUJK","klW0myvn","hwWceR4m","t18CfscF","pu9hcKsp","3GURrv52","BlDe1jqg","Nbrq3pvu","IQGoFJYP","Y5BmdUtM","tiS16mGn","aTvlJ7V9","yvGMz75G","qPvk2bmy","na30ifJS","pf9z7BdE","EZUmgjMH","fTlqeNs3","LwT3i65m","5q2RWTZ9","zRROXgDL","GnrWAVQK","4AR5fMpn","30DEnQJE","fN6SUor0","ePSovy2R","yQVnODwU","l3neajc5","Z9fVV1cT","62dNqSyR","2oGTbJ0i","h7A9nDyj","Xe0n6L7a","JLW0F6Gv","fI2Xyf3B","7uEaptM0","KdL0z8sJ","6BTKfXuu","rr2I0f2d","TCo8qr8m","mMwP6MUu","FrcMJxfb","ATa0nUu5","2CnNdiUT","QMBYfAuO","tjDEdddl","eqzpUTwV","ShUp2kQ2","FszY2hte","jdeTwq6v","MWDyKE94","nAHGB5ls","hefSwtn6","LAhdYjOV","RE9nKxFT","5DAuFkN0","U9UF2NCO","U9tSAZs1","BBnb9L4J","fgAAuioX","s3z1jvdQ","twamfmIi","3ene3W1l","aeoQuGBI","jo7lDoK4","j6eeqvpj","ubLGNAmB","Lx1PnbXS","PLwDM096","vDtmuZ5u","pnjn9POx","E20MlpTh","EIZSZGPU","1ZHtT6Xo","Vy1NNwxO","2zQSp93Z"],"wiki_url":null},{"_id":"Ua7DFN59","additional_categories":[],"approved":"2022-11-28T18:42:13.412406Z","body":"<p><img src=\"https://i.imgur.com/1SgmaLx.png\" alt=\"\" width=\"1344\" height=\"416\" /><br /><br />\n<a title=\"Join the YUNG GANG on Discord!\" href=\"https://discord.gg/rns3beq\" target=\"_blank\" rel=\"noopener\"><img src=\"https://tinyurl.com/yungsdiscordbadge2\" alt=\"Join the YUNG GANG on Discord!\" width=\"136\" height=\"28\" /></a>&nbsp;<a title=\"Follow me on Twitter!\" href=\"https://twitter.com/yungnickyoung\" target=\"_blank\" rel=\"noopener\"><img src=\"https://tinyurl.com/yungstwitterbadge3\" alt=\"Follow me on Twitter!\" width=\"76\" height=\"27\" /></a>&nbsp;<a title=\"Subscribe to my YouTube!\" href=\"https://www.youtube.com/yungnickyoung\" target=\"_blank\" rel=\"noopener\"><img src=\"https://tinyurl.com/yungsyoutubebadge\" alt=\"Subscribe to my YouTube!\" width=\"80\" height=\"30\" /></a>&nbsp;<a title=\"Support me on Patreon!\" href=\"https://patreon.com/yungnickyoung\" target=\"_blank\" rel=\"noopener\"><img src=\"https://tinyurl.com/yungspatreonbadge\" alt=\"Support me on Patreon!\" width=\"138\" height=\"28\" /></a></p>\n<p>This is a library mod for YUNG's mods.</p>\n<p><b>For all my mod devs out there - </b>This provides a lot of useful stuff, especially if you're a worldgen modder!</p>\n<p>The API includes the following:</p>\n<ul>\n<li>AutoRegistration system (1.18+ only). Register any field with only a simple annotation, regardless of mod loader!</li>\n<li>Custom reimplementation of Jigsaw Manager with improved performance and custom pool element types with various new properties. Check out the <a href=\"https://github.com/yungnickyoung/YUNGs-Better-Dungeons\" target=\"_blank\" rel=\"noopener noreferrer\">Better Dungeons code</a> to see it in action.</li>\n<li>New criteria trigger for safely locating any structure. If the given structure doesn't exist, the trigger simply fails rather than instantly passing (unlike vanilla).</li>\n<li>Interfaces for JSON serialization &amp; deserialization&nbsp;with built-in type adapters.</li>\n<li>Simple, lightweight math utilities for vectors and column positions</li>\n<li><em>BlockStateRandomizer</em> and <em>ItemRandomizer</em>, data abstractions that make adding block and item randomization to your structures incredibly simple. I use these for all of my mods!</li>\n</ul>\n<p>If you're curious, you can check the code for my mods (especially the newer ones) to see how things work. Feel free to ask me any questions on Discord!</p>\n<p><img src=\"https://i.imgur.com/a49IMQJ.png\" /><br />\n<a title=\"Get 25% off your server with code YUNGNICKYOUNG at Bisect Hosting!\" href=\"http://sbisecthosting.com/yung\" target=\"_blank\" rel=\"noopener noreferrer\"><img src=\"https://i.imgur.com/nQRs7ZP.png\" alt=\"Use code YUNGNICKYOUNG with Bisect Hosting for 25% off!\" width=\"1344\" height=\"400\" /></a></p>","body_url":null,"categories":["library","worldgen"],"client_side":"required","color":5970187,"description":"Library mod for YUNG's mods.","discord_url":"https://discord.gg/rns3beq","donation_urls":[{"id":"patreon","platform":"Patreon","url":"https://www.patreon.com/yungnickyoung"}],"downloads":5203545,"followers":1418,"found":true,"gallery":[],"game_versions":["1.18.2","1.19.2","1.19.3","1.19.4","1.20","1.20.1","1.20.4","1.21","1.21.1"],"icon_url":"https://cdn.modrinth.com/data/Ua7DFN59/0fab1c351bf00926a8e1c91dc64b7c88832c3e1f_96.webp","issues_url":"https://github.com/YUNG-GANG/YUNGs-API/issues","license":{"id":"LGPL-3.0-only","name":"GNU Lesser General Public License v3.0 only","url":null},"loaders":["fabric","forge","neoforge"],"moderator_message":null,"monetization_status":"monetized","project_type":"mod","published":{"$date":"2022-11-28T17:17:12.676Z"},"queued":{"$date":"2022-11-28T17:17:12.676Z"},"requested_status":null,"server_side":"required","slug":"yungs-api","source_url":"https://github.com/YUNG-GANG/YUNGs-API","status":"approved","sync_at":"2025-01-07T15:28:20Z","team":"3TidTIHz","thread_id":"Ua7DFN59","title":"YUNG's API","translated_description":"YUNG的API库模组","updated":"2024-11-21T04:28:42.692023Z","versions":["xET3UZBe","UNVzqGkX","82XBGKbQ","xvoWCwex","LYoQlbQt","YwHWUw19","LEuKu3qt","Em3G31xp","dpSzBMP6","IOIGqCVr","i0Z1vSK9","YZE1pnbT","GNNfW5IV","IxuGYnWF","yIFytswN","h32n7OPC","4Ek11kQV","NmrTF2A5","TT8tnzlH","HIRzLg0r","pxmQWPn7","L5GqhLVE","QnR5jGmc","hyQxutx9","rbgh8n1F","5Zb55w2q","k1OTLc33","sE5QMX20","RXxBbRs7","wddoDji1","dpTBMhjf","jLW564iU","a7qxhSOZ","aMs83SRk","zPT7QfIk","Nx7XHO30","mBbkZrZ1","fFD2YR4D","PJOYAmAs","lscV1N5k","LkDReYww","tumhJgug","MIGLewpu","PpGXywDf","ex8YYvxI","LMXPKbZf","DeaIlZ9A","97xRZcgc","MoMQNZ94"],"wiki_url":null}]

data/modrinth_versions.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

data/redis_data.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
select 4
2+
SADD modrinth_project_ids d4n3eSLH cUL49efx BgdiIblC
3+
SADD modrinth_version_ids nBOzkT2A MGxMpFT6
4+
SADD modrinth_hashes_sha1 42d4dd49909f0a80f87c564db3dd9e7eab2c08d1 5fcc2d744fcc24b09071291ba7eaaa34f9662465
5+
SADD modrinth_hashes_sha512 901f437dae574b07709cf38fb24f3135001cc46ac1b05761a9bf73ce65219c53785578 26ec3eba1964ccba1e938eb26eb8b38bc47a84e82018861360fbda60913f983e2b5f2f
6+
SADD curseforge_modids 921429 884660 421090
7+
SADD curseforge_fileids 4577334 5346482 399820
8+
SADD curseforge_fingerprints 990744918 3180985430

justfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
mongodb-tool-install:
2+
sudo apt-get install gnupg curl
3+
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \
4+
sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \
5+
--dearmor
6+
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
7+
sudo apt-get update
8+
sudo apt install mongodb-database-tools
9+
10+
redis-tool-install:
11+
sudo apt-get install lsb-release curl gpg
12+
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
13+
sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
14+
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
15+
sudo apt-get update
16+
sudo apt install redis-tools # for redis-cli
17+
18+
import-data:
19+
mongoimport --db mcim_backend --collection modrinth_projects --file ./data/modrinth_projects.json --jsonArray
20+
mongoimport --db mcim_backend --collection modrinth_versions --file ./data/modrinth_versions.json --jsonArray
21+
mongoimport --db mcim_backend --collection modrinth_files --file ./data/modrinth_files.json --jsonArray
22+
mongoimport --db mcim_backend --collection curseforge_mods --file ./data/curseforge_mods.json --jsonArray
23+
mongoimport --db mcim_backend --collection curseforge_files --file ./data/curseforge_files.json --jsonArray
24+
mongoimport --db mcim_backend --collection curseforge_fingerprint --file ./data/curseforge_fingerprints.json --jsonArray
25+
redis-cli --pipe < ./data/redis_data.txt
26+
27+
ci-install:
28+
pip install -r requirements.txt
29+
pip install pytest
30+
31+
ci-test:
32+
pytest ./tests -vv -rpP
33+
34+
ci-config:
35+
echo $CONFIG > config.json

0 commit comments

Comments
 (0)