mirror of
https://github.com/GoldfishJonny/Andromeda.git
synced 2025-12-09 11:01:06 -08:00
ConvertBase64toServerProfile.py
This commit is contained in:
parent
5260bd6a24
commit
5ef0734d5e
9
ConvertBase64toServerProfile.py
Normal file
9
ConvertBase64toServerProfile.py
Normal file
@ -0,0 +1,9 @@
|
||||
import base64
|
||||
import sys
|
||||
|
||||
base64_data = open(sys.argv[1], "r").read()
|
||||
|
||||
output_file = sys.argv[1].replace(".txt", ".png")
|
||||
|
||||
with open(output_file, "wb") as f:
|
||||
f.write(base64.b64decode(base64_data.strip()))
|
||||
@ -1,23 +1,24 @@
|
||||
# Andromeda
|
||||
|
||||
This repository contains two scripts, chooseIcon.sh and motd.sh, that dynamically randomize the Minecraft server's icon and message of the day (MOTD) on startup.
|
||||
## Purpose
|
||||
|
||||
- chooseIcon.sh: Randomly selects a PNG icon (icon*.png) from /home/minecraft/icons and sets it as the server-icon.png.
|
||||
|
||||
- motd.sh: Randomly selects a line from one of the motd*.txt files in /home/minecraft/motd and updates the motd field in your server.properties.
|
||||
|
||||
- ConvertBase64toServerProfile.py: Converts Base64 encoded image from old server info found in NBT files and converts it back to an image for a server icon.
|
||||
|
||||
Requirements
|
||||
|
||||
- The icons must be stored in: /home/minecraft/icons
|
||||
- The icons must be stored in: ./icons
|
||||
|
||||
- The MOTD text files must be stored in: /home/minecraft/motd
|
||||
- The MOTD text files must be stored in: ./motd
|
||||
|
||||
- The Minecraft server.properties file must be located within the server directory or a subdirectory of where the script is called.
|
||||
|
||||
## Usage
|
||||
|
||||
To use these scripts, call them from your Minecraft server's start.sh script before the server starts.
|
||||
To use chooseIcon.sh and motd.sh scripts, call them from your Minecraft server's start.sh script before the server starts.
|
||||
|
||||
If your start.sh file is outside the server directory (i.e., the server is in a subdirectory), you must provide the server directory as a parameter when calling motd.sh.
|
||||
Example start.sh (located one level above the server folder):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user