Jump to content

Minecraft (Automatic Java Version - Multiple Mods)


Dennis
 Share

Recommended Posts

Minecraft (Automatic Java Version - Multiple Mods)


Read before installing

To automatically update Minecraft, Spigot, Craftbukkit and Paper, use the following module:

 

Installation

  1. Download the config
  2. Go to TCAdmin > System > Settings > Game & Voice Hosting > Game & Other Voice Servers > Import
  3. Save the config as a new config or chose "Overwrite existing config" if you which to overwrite your current Minecraft config. Remember to select Minecraft in the 'Update Game' field if you do
  4. Leave all other settings

Features

  • Java is bundled with the config (Adoptium 8, 11, 16 and 17)
  • Backup/Restore worlds
  • Spigot, Craftbukkit, Paper and Tuinity included as mods
  • For modpacks, please use "Custom Mods" module (can be configured from the "Custom Mods" section in the Minecraft config)
  • Support for multiple Java versions
    • Before start, TCAdmin will try to determine the required version of Java
      • If you have manually installed the different Java versions and added the path to java.exe (or java on Linux) to the environment variable as JAVA8, JAVA11, JAVA16 and JAVA17, TCAdmin will not include Java binaries with the files. It will instead use the system-installed versions
      • If no environment variables for Java is detected, Java binaries are downloaded into the "java" directory on the server (these gets updated automatically once per week via a scheduled task)
      • For existing services where no "java" folder is found and where no environment variable exists, TCAdmin will use the default "java" command as previously
    • If TCAdmin is not able to detect the required Java version, it will default to Java 11.
    • Client can manually specify a version they want to use. In this case, TCAdmin will not try to detect the required version.
  • Unlimited players by default (can be changed through Query Monitoring > Slot Detection)
  • Users can use their own .jar files
  • Easy configuration through configuration editor

Use system-installed Java versions instead of bundling Java with the game service (recommended)

  1. Download the versions of Java you want (this config supports Java 8, Java 11, Java 16 and Java 17). Make sure they are installed in different directories.
    If you want to use Temurin from Adoptium, you can follow these guides: https://adoptium.net/installation
  2. After installation, you will need to setup environment variables that point to each Java version
    1. Windows:
      1. Open 'Run' and enter this: rundll32.exe sysdm.cpl,EditEnvironmentVariables
      2. Under 'System variables' create one variable for each version of Java. Make sure to name them as JAVA8, JAVA11, JAVA16 and JAVA17 - it's important
      3. The "Variable Value" field should point to the specific version's java.exe file
      4. Save the variables
    2. Linux:
      1. Open the file /home/tcadmin/Monitor/tcadmin-config
      2. Create a new line consisting of
        export JAVA<version>="/path/to/java"
        for each version of Java you want to use
        Example:
        export JAVA8="/opt/java8/bin/java"
        export JAVA11="/opt/java11/bin/java"
        export JAVA16="/opt/java16/bin/java"
        export JAVA17="/opt/java17/bin/java"
      3. Save the file
  3. Make sure to restart both the TCAdmin2 Monitor and TCAdmin2 Service Manager after setting the environment variables. TCAdmin will not be able to recognise the variables if you don't restart. If you're having any issues, try restarting the system.

Suggestions are appreciated.

Known issues:

  • Java download fails on some Linux distributions. If you're having this issue, please contact me. I will probably need access to your TCAdmin installation to resolve this matter.

 

Link to comment
Share on other sites

I spoke to Luis a few weeks back asking if he can test spiget again.

 

It looks like CF isnt blocking it anymore i think they excluded .jar and .zip from the ddos check.

 

Anyways he said it's working and should be available in this upcoming version of TCA.

 

Sent from my SNE-LX1 using Tapatalk

 

 

 

 

Link to comment
Share on other sites

Great to hear!

I'm in the process of rewriting the custom IronPython scripts so they won't require the Standard Python Library to be loaded. Should be available sometime next week.

Link to comment
Share on other sites

On 3/4/2020 at 10:27 PM, SHAD0WRAIDERZA said:

I spoke to Luis a few weeks back asking if he can test spiget again.

 

It looks like CF isnt blocking it anymore i think they excluded .jar and .zip from the ddos check.

 

Anyways he said it's working and should be available in this upcoming version of TCA.

 

Sent from my SNE-LX1 using Tapatalk

 

 

 

 

Here is the way we get around cloudflare when downloading twitch/curse mod packs:

 

URL=https://www.curseforge.com/minecraft/modpacks/minecraft-eternal/download/2870726
DURL=$(curl -i -s --tlsv1.3 --header \
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
--compressed --header "Accept-Language: en-US,en;q=0.5" \
--header "Upgrade-Insecure-Requests: 1" \
--user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0" "${URL}/file" \
| grep location | awk '{first = $1; $1 = ""; print $first; }' | sed 's/^ //g' | sed 's/\\r//g') \
DURL=${DURL%$'\r'} && FILE=${DURL##*/} && curl -o ${FILE// /-} -L -O "${DURL}"

 

Code partially written by myself if you need any of it explained.

You put the modpack url in and it downloads it, it follows the redirects too.

Link to comment
Share on other sites

3 hours ago, mouseymars said:

Here is the way we get around cloudflare when downloading twitch/curse mod packs:

 

URL=https://www.curseforge.com/minecraft/modpacks/minecraft-eternal/download/2870726
DURL=$(curl -i -s --tlsv1.3 --header \
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
--compressed --header "Accept-Language: en-US,en;q=0.5" \
--header "Upgrade-Insecure-Requests: 1" \
--user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0" "${URL}/file" \
| grep location | awk '{first = $1; $1 = ""; print $first; }' | sed 's/^ //g' | sed 's/\\r//g') \
DURL=${DURL%$'\r'} && FILE=${DURL##*/} && curl -o ${FILE// /-} -L -O "${DURL}"

 

Code partially written by myself if you need any of it explained.

You put the modpack url in and it downloads it, it follows the redirects too.

We talking about Spiget https://spiget.org/

Link to comment
Share on other sites

What's New in Version 1.1.0  

Custom Scripts has been updated to no longer require the Standard Python 2.7 Library.

If you experience any problems, please post them in the thread.

Link to comment
Share on other sites

  • 4 weeks later...

I get the error "The update can't be installed at this time" when trying to install something from the "Updates" tab.

 

If I get the URL and try manually download it, it also fails and takes me to a 404 Not found page saying

  • Code: NoSuchKey
  • Message: The specified key does not exist.
Link to comment
Share on other sites

  • 4 weeks later...

Sure, Bungeecord will also be uploaded. It will be added as a standalone config, though. I just need to fix an issue I have with external downloads.

Link to comment
Share on other sites

  • 8 months later...

Hello .. Im facing a problem running MC with this config. Have you tested it recently ??

 

[01:31:21] [Server thread/ERROR]: Exception stopping the server
java.lang.NullPointerException: null
	at net.minecraft.server.MinecraftServer.a(SourceFile:572) ~[minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.t(SourceFile:599) ~[minecraft_server.jar:?]
	at zg.t(SourceFile:567) ~[minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.w(SourceFile:707) ~[minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.a(SourceFile:257) ~[minecraft_server.jar:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_281]

 

Link to comment
Share on other sites

I installed java as system variable .. Restart server ... Works

 

If your able to include a script for starting MC server as once java fires up .. it eats alot of cpu then it lowers. Maybe same idea as your RUST config would be great. Thx

Edited by conceptr980
Link to comment
Share on other sites

  • 2 weeks later...

I am struggling to get this to work i have imported the config and it shows up when i check back 4CnVHMn.png

So Its uploaded fine, but when i go to create a new service it will not show up at all, even if i select show hidden, I have imported other games configs before and they work, not entirely sure the reason for this

 

Tlj4pNg.png

Link to comment
Share on other sites

  • 3 months later...

What's New in Version 1.2.0  

Please read before updating/installing. This config is changing how services start and might break things until it has been tested and changed enough.
Linux config needs more testing.

From now on, the config will automatically download Java (AdoptOpenJDK JRE 8 and AdoptOpenJDK JRE 16 OpenJ9). This config will not use the version of Java you have installed on your server (only as fallback, in case AdoptOpenJDK files are not found)

  • [Added] Executable files for OpenJRE
  • [Added] TCAdmin will try to decide what version of Java the service should be started with (OpenJRE 8 up to Minecraft 1.16.5, OpenJRE 16 for 1.17 and above)
    • Minecraft 1.17 includes a version.json that specifies what version of Java is needed. If this is found, it uses OpenJRE 16
    • If version.json does not exist, or if TCAdmin can't conclude what version of Java is needed, it will fall back to OpenJRE 8
    • If OpenJRE doesn't exist on the game server, it will fall back to system installed Java
  • [Added] Download/Update OpenJRE from "More" > "Download Java".

Known issues:

  • There's no way to automatically update every bundled Java version. This could be a security risk
  • Before service is started, TCAdmin opens the .jar file with the ZipFile module in Python. Sometimes the file is not closed automatically
    • If you find a way to consistently reproduce the error, please contact me
Link to comment
Share on other sites

What's New in Version 1.2.1  

This version contains a few fixes (mostly for Linux). Changelog for 1.2.0 included below.

  • [Fixed] Linux config couldn't extract OpenJDK JRE tar.gz files
  • [Fixed] Linux minecraft_server.sh now includes shebang
  • [Changed] 'Wait for Exit' changed to 10 for Linux config
  • [Changed] Default command line changed to run vanilla Minecraft (minecraft_server.jar)
  • [Changed] EULA now contains a link to the Minecraft EULA
  • [Added] External Download in case minecraft_server.jar doesn't exist

Changelog for 1.2.0:

Please read before updating/installing. This config is changing how services start and might break things until it has been tested and changed enough.
Linux config needs more testing.

From now on, the config will automatically download Java (AdoptOpenJDK JRE 8 and AdoptOpenJDK JRE 16 OpenJ9). This config will not use the version of Java you have installed on your server (only as fallback, in case AdoptOpenJDK files are not found)

  • [Added] Executable files for OpenJRE
  • [Added] TCAdmin will try to decide what version of Java the service should be started with (OpenJRE 8 up to Minecraft 1.16.5, OpenJRE 16 for 1.17 and above)
    • Minecraft 1.17 includes a version.json that specifies what version of Java is needed. If this is found, it uses OpenJRE 16
    • If version.json does not exist, or if TCAdmin can't conclude what version of Java is needed, it will fall back to OpenJRE 8
    • If OpenJRE doesn't exist on the game server, it will fall back to system installed Java
  • [Added] Download/Update OpenJRE from "More" > "Download Java".

Known issues:

  • There's no way to automatically update every bundled Java version. This could be a security risk
  • Before service is started, TCAdmin opens the .jar file with the ZipFile module in Python. Sometimes the file is not closed automatically
    • If you find a way to consistently reproduce the error, please contact me
Link to comment
Share on other sites

  • 4 weeks later...

Hey there @Dennis,

I'm having an issue with your minecraft config, as it shows the server name as Invalid, I've attached a few snapshots of what I'm talking about and everything I do doesn't seem to help with the situation. I've also disabled the hostname option to see if it would work, and it didn't help the issue at all.  If you could please assist I'd greatly appreciate it. 

spacer.pngspacer.png

Link to comment
Share on other sites

@Joey Misfit Server names was only a thing for early version of Minecraft. There's no way to set a server name. I removed it a couple of months ago as it's only real purpose was to show a name in TCAdmin.

Your theme probably expects a hostname to be set which is why it shows up as "Invalid". On default themes, the hostname area simply won't appear.

Link to comment
Share on other sites

4 hours ago, Dennis said:

@Joey Misfit Server names was only a thing for early version of Minecraft. There's no way to set a server name. I removed it a couple of months ago as it's only real purpose was to show a name in TCAdmin.

Your theme probably expects a hostname to be set which is why it shows up as "Invalid". On default themes, the hostname area simply won't appear.

@DennisWould this by chance be the cause of it? 

<div class="col mr-2">
                        <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Server Name</div>
                        <div class="h5 mb-0 font-weight-bold text-gray-800">@(string.IsNullOrWhiteSpace(Model.SelectedServer.Name) ? "Invalid" : Model.SelectedServer.Name)</div>
                    </div>

 

Link to comment
Share on other sites

Yes, that's it. If Model.SelectedServer.Name is null, you shouldn't show that column.

I'll see if I can find another way to let clients set the name, though. I might even re-implement the server-name.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Who's Online   0 Members, 0 Anonymous, 7 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use