Skip to content

Basic Information (IMPORTANT)

N-aksif-N edited this page Apr 15, 2024 · 13 revisions

Logo

Mine Colab [Improved]

Run Minecraft Server on Google Colab

Star Open In Colab Download

Today, I will explain the basic information for developing the main functions. Because each main function has its own small function, I will tell it on the page that describes the main function not in this page.

Python libraries:

Libraries Commands Uses X Libraries Commands Uses
os environ() Setting java environment X jproperties Properties() Read server.properties files
os.path exists() Checking exsisting folder X rich print() print color texts
requests get() HTML Parse X google.colab drive() Mounting google drive
time sleep() Wait for done (Commands) X pyngrok ngrok() Ngrok connecting
json load() Transform to dict type X pyngrok conf() Ngrok configuring
json dump() Dumping dict values to .txt files X bs4 BeautifulSoup4() HTML Parse

Global variables:

  • drive_path : Path to your drive files.
  • SERVERCONFIG : Path to your serverconfig.txt file.
  • COLABCONFIG : Function but used for getting the path to colabconfig.txt file.
  • JAR_LIST_RUN : Function, return dict value including jar file name for each software.

Function 1: LOG, GET, DOWNLOAD_FILE -- Necessary function

  • LOG:
    • Purpose: Print color texts
    • Mechanism:

image

  • GET:
    • Purpose: HTML parse.
    • Mechanism:

image

  • DOWNLOAD_FILE:
    • Purpose: Download jar files.
    • Mechanism:

image

Function 2: COLABCONFIG_LOAD, SERVER_IN_USE

  • COLABCONFIG_LOAD:
    • Purpose: Load colabconfig content
    • Mechanism:

image

  • SERVER_IN_USE:
    • Purpose:
      • Check whether server_name exists.
      • Get servers that are in use. (if server_name is an empty string)
    • Mechanism:

image

Function 3: INSTALL_JAVA

  • Purpose: Install Java (Java 8 for versions < 1.17 except from 1.16.5 and Java 17 for versions > 1.17)
  • Mechanism: In-process

Function 4: SERVERSJAR

-- Inprocess

Introduction:

  • This page is all about how the main functions in the scripts work.
  • It is important for developers/ contributors to read this.
Clone this wiki locally