Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forge installer doesnt get replaced with actual forge server jar #6

Open
Osiris-Team opened this issue Jan 13, 2024 · 15 comments
Open
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Osiris-Team
Copy link
Collaborator

Osiris-Team commented Jan 13, 2024

I just tested it on my system and a popup opens up where I need to select server and then it installs it into the .minecraft folder.
And this repeats every time you enter .start to launch the server.
Bild
looking into this issue
Arman Kandel (Osiris) — 28.12.2023 20:23
for now disable the server updater and give the absolute path in the start command which should be something like (on windows)
java -jar C:\Users\arman\AppData\Roaming.minecraft\libraries\net\minecraftforge\forge\1.18.2-40.2.14\forge-1.18.2-40.2.14-server.jar
Arman Kandel (Osiris) — 28.12.2023 20:27

@Osiris-Team Osiris-Team self-assigned this Jan 13, 2024
@HSGamer
Copy link
Owner

HSGamer commented Jan 13, 2024

ForgeUpdater has been removed because of this issue.
Will need to find a better & reliable way to fetch the installer jar and build server jar from that.

@Osiris-Team
Copy link
Collaborator Author

Osiris-Team commented Jan 23, 2024

We could get the real server jar from this path maybe? C:\Users\arman\AppData\Roaming.minecraft\libraries\net\minecraftforge\forge\
would require us to find out the username maybe.
How is it on linux though?

Just found the forge installer has a installServer commandline argument that installs the server into the current directory, which would be I think exactly what we need: https://github.com/MinecraftForge/Installer/blob/74183ebebae9bff4719500c76721987af52b746b/src/main/java/net/minecraftforge/installer/SimpleInstaller.java#L73

@Osiris-Team
Copy link
Collaborator Author

Osiris-Team commented Jan 23, 2024

@HSGamer yeah just tested it out and it works, the command looks something like this, after downloading the installer:
java -jar .\forge-1.20.2-48.1.0-installer.jar --installServer

I'm still not sure where the server jar finally is, probably it doesnt exist and all the libs get added to the default mc server jar at boot, thats why autoplug should just update the start command to start-command: ./run.sh (or .bat if windows).

So can we add the original code for the forge updater back? And also update the command to run the installer?

image

@HSGamer
Copy link
Owner

HSGamer commented Jan 24, 2024

@HSGamer yeah just tested it out and it works, the command looks something like this, after downloading the installer:
java -jar .\forge-1.20.2-48.1.0-installer.jar --installServer

I'm still not sure where the server jar finally is, probably it doesnt exist and all the libs get added to the default mc server jar at boot, thats why autoplug should just update the start command to start-command: ./run.sh (or .bat if windows).

So can we add the original code for the forge updater back? And also update the command to run the installer?

image

The problem is that it creates the full server setup, not a single server jar.

@Osiris-Team
Copy link
Collaborator Author

@HSGamer here is what ChatGPT says about the forge start command:

It looks like you've provided a command line configuration for launching a Minecraft Forge server using the Forge Mod Loader (FML) and some specific libraries. Let me break down the important components of this command:

  1. Classpath (specified by -p):

    • Various JAR files are specified in the classpath, including libraries related to Google Guava, Forge, ASM (Objectweb ASM), secure modules, and other dependencies required for running a Forge server.
  2. Module Path (specified by --add-modules ALL-MODULE-PATH):

    • This option indicates that all JAR files in the specified classpath will be treated as modules. This is a way to use the module system introduced in Java 9.
  3. Exports (specified by --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming):

    • This option adds a specific export statement for the given package. In this case, it exports the com.sun.jndi.dns package to java.naming.
  4. System Properties (specified by -D):

    • Several system properties are set using the -D flag. Notable ones include:
      • java.net.preferIPv6Addresses=system: This sets the preference for IPv6 addresses.
      • ignoreList: Specifies a list of JAR files to be ignored.
      • libraryDirectory: Specifies the directory where libraries are located.
      • legacyClassPath: Specifies the classpath for legacy dependencies.
  5. Main Class and Launch Parameters:

    • The main class is specified as net.minecraftforge.bootstrap.BootstrapLauncher.
    • Additional parameters specific to Forge server launch are provided, such as --launchTarget, --fml.forgeVersion, --fml.mcVersion, --fml.forgeGroup, and --fml.mcpVersion.

It seems like this command is designed to launch a Minecraft Forge server with specific versions and configurations. Ensure that all the specified libraries are available in the specified directory, and the required dependencies are correctly set up. Additionally, make sure you have the appropriate Java version installed to run this Minecraft Forge server.

@Osiris-Team
Copy link
Collaborator Author

@HSGamer basically you can think of it as an extracted server jar. When usign the installer agin those files get updated so I dont see the problem.

@HSGamer
Copy link
Owner

HSGamer commented Jan 25, 2024

@HSGamer basically you can think of it as an extracted server jar. When usign the installer agin those files get updated so I dont see the problem.

Another problem is the start script file. It's different for each OS.

@Osiris-Team
Copy link
Collaborator Author

The actual command inside the .sh and .bat should be the same. But this shouldn't be a worry of the server updater.

@HSGamer
Copy link
Owner

HSGamer commented Jan 25, 2024

The actual command inside the .sh and .bat should be the same. But this shouldn't be a worry of the server updater.

There are still problems with this updater

  • If we want to provide a single server jar as the output, this can't do.
  • If we provide the update for the installer, the user will need to run the installServer command AND the start file.
  • If we want to support fetching old versions, the link to that is different from the one in newer versions (probably from 1.12 and above).

Since I don't work on Forge Updater, I will leave this to you or someone who can solve these problems above.

@HSGamer HSGamer added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jan 25, 2024
@Osiris-Team
Copy link
Collaborator Author

Instead of providing the jar as output we can provide the run.sh/bat script. This should be ok since its only for forge and there isn't really another alternative.

The user won't have to run anything, server-updater will run the installer jar.

Supporting older versions can be done later, its not a priority now I would say. Since those older versions probably stopped receiving updates anyways.

@HSGamer
Copy link
Owner

HSGamer commented Jan 25, 2024

The user won't have to run anything, server-updater will run the installer jar.

We won't. It's different from Bungee Updater.

@Osiris-Team
Copy link
Collaborator Author

Im not following, why can't we run the installer jar?

@HSGamer
Copy link
Owner

HSGamer commented Jan 25, 2024

Im not following, why can't we run the installer jar?

I mistyped. It's different from the Spigot Updater.
The output of BuildTools is a single jar file so we can handle it easily as the output of the Server Updater.
But the output of Forge Installer is a full server setup with several jar files. We can't handle them as a single output of the Server Updater.

@Osiris-Team
Copy link
Collaborator Author

Mhmm, meaning to calculate the checksum to see if there is an update available?
In that case we can return the installer jar instead for this to work?

@HSGamer
Copy link
Owner

HSGamer commented Jan 25, 2024

Mhmm, meaning to calculate the checksum to see if there is an update available?
In that case we can return the installer jar instead for this to work?

Then there is the second problem I mentioned above. The user needs to run both installServer and the start script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants