-
Notifications
You must be signed in to change notification settings - Fork 56
Install server
Run Minecraft Server on Google Colab
Hello, nice to meet you here. So, today I will tell you how Install_sever (function) works. Let's jump right in!
Developers don't have to see this. But, it's necessary to be included in today's page
Libraries | Commands | Uses |
---|---|---|
google.colab | drive() | Mounting google drive |
os | environ() | Setting java environment |
os.path | exists() | Checking exsisting folder |
requests | get() | HTML Parse |
json | load() | Transform to dict type |
json | dump() | Dumping dict values to .txt files |
bs4 | BeautifulSoup4() | HTML Parse |
-
Some had been included in Basic Information (IMPORTANT)
-
Global variables:
- COLABCONFIG()
- SERVERCONFIG
-
Input variables:
- tunnel_service: tunnel service (ngrok, playit, cloudflare-argo)
- authtoken: Your ngrok auth token (if tunnel_service is 'ngrok')
- region: Your region (if tunnel_service is 'ngrok')
- server_name: The server folder name
- type_: The server software type
- version: The server version (set automatically to 'vanilla - latest_version')
-
Global function:
- DOWNLOAD_FILE()
-
Small function ( for only Install_server function):
-
JAR_LIST_RUN:
-
Purpose: Get jar file name according to the server type
-
This is just a dict value, not a function. But the jar file for forge type needed server version value => Using function type.
-
Return value:
{'generic': 'server.jar', 'vanilla':'server.jar','snapshot': 'server.jar', 'purpur' : 'server.jar', 'paper': 'server.jar', 'velocity' : 'server.jar', 'fabric' : 'server.jar', 'forge': 'minecraft_server.' + colabconfig['server_version'] + '.jar', # forge can't change the jar file 'arclight' : 'server.jar', 'mohist': 'server.jar', 'banner': 'server.jar'}
-
-
SERVERSJAR:
- Purpose: Get the download URL (jar) AND return the detailed versions for each software (all)
- API URLs(all):
- vanilla or snapshot: https://launchermeta.mojang.com/mc/game/version_manifest.json,
- paper: https://api.papermc.io/v2/projects/paper, velocity: https://api.papermc.io/v2/projects/velocity,
- purpur: https://api.purpurmc.org/v2/purpur,
- mohist: https://mohistmc.com/api/v2/projects/mohist, banner: https://mohistmc.com/api/v2/projects/banner,
- arclight : https://files.hypoglycemia.icu/v1/files/arclight/minecraft,
- fabric: https://meta.fabricmc.net/v2/versions/game, forge: https://files.minecraftforge.net/net/minecraftforge/forge/index.html
- Download URLs (jar): Because there are too many URLs to be added, I don't insert them here. Just look at the code.
- Mechanism:
-
- Purpose: Install server for each software
- Mechanism: