Code Monkey home page Code Monkey logo

Comments (4)

kazantsev-v avatar kazantsev-v commented on May 24, 2024

After a long time, I decided to repeat the previous experience, but the miracle of history repeated itself. This error falls out no matter what you do.
msedge_SE3sPZIY8Y

from minecolab.

thecoder-001 avatar thecoder-001 commented on May 24, 2024

Hi!
Sorry for the late response. You should be able to connect to the server even after the errors.
At least that's what seems to be happening in my case. Still I would try to figure out if something else is going wrong, though not being able to reproduce it on my end would make it hard.

image

from minecolab.

kazantsev-v avatar kazantsev-v commented on May 24, 2024

Thanks for the reply!
Anyway, I didn't fix the error, but I was able to connect playit.gg through their plugin - https://www.spigotmc.org/resources/playit-gg.105566/
Although essentially the same, perhaps I entered something wrong, and the plugin automatically corrected my mistakes. :)

from minecolab.

DEFYREALITY250 avatar DEFYREALITY250 commented on May 24, 2024

Thanks for the reply! Anyway, I didn't fix the error, but I was able to connect playit.gg through their plugin - https://www.spigotmc.org/resources/playit-gg.105566/ Although essentially the same, perhaps I entered something wrong, and the plugin automatically corrected my mistakes. :)

Can confirm it does work my advice remove the last lines other than:
print('Starting server...')
!java $memory_allocation $server_flags -jar $jar_name nogui

I also added 10.5gb of ram all of the code is:

import os
import re
import json

Update the package lists

!sudo apt update &>/dev/null && echo "apt cache successfully updated" || echo "apt cache update failed, you might receive stale packages"

Install OpenJDK 17

!wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -

!sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ &>/dev/null || echo "Failed to add repo. Still can be ignored if openjdk17 gets installed."

!sudo apt-get install openjdk-17-jre-headless &>/dev/null && echo "Yay! Openjdk17 has been successfully installed." || echo "Failed to install OpenJdk17."
#Perform java version check
java_ver = !java -version 2>&1 | awk -F[".] -v OFS=. 'NR==1{print $2}'
if java_ver[0] == "17" :
print("Openjdk17 is working correctly, you are good to go.")
else:
print("Openjdk17 doesn't seems to be installed or isn't working, falling back to java", java_ver[0], ". You might experience reduced performance. Minecraft 1.17 and above might fail to launch.")

Mount Google Drive

from google.colab import drive
drive.mount('/content/drive')

Change directory to the Minecraft server folder on Google Drive

%cd "/content/drive/My Drive/Minecraft-server"
!ls #list the directory contents (to verify that working directory was changed)

Import config file.

if os.path.isfile("colabconfig.json"):
colabconfig = json.load(open("colabconfig.json"))
else:
colabconfig = {"server_type": "generic"} # using default, if config doesn't exists.
json.dump(colabconfig, open("colabconfig.json",'w'))

Server jar names.

jar_list = {'paper': 'server.jar', 'fabric': 'fabric-server-launch.jar', 'generic': 'server.jar'}
jar_name = jar_list[colabconfig["server_type"]]

Java arguments.

if colabconfig["server_type"] == "paper":
server_flags = "-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true"
else:
server_flags = "" # aiker's flags might negatively impact performance on non-paper servers.
memory_allocation = "-Xmx10500M -Xms10500M"

print('Starting server...')
!java $memory_allocation $server_flags --add-modules=jdk.incubator.vector -jar $jar_name nogui

from minecolab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.