itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.47k stars 1.55k forks source link

Update NeoForge resolution for 1.20.2+ #2558

Closed itzg closed 10 months ago

itzg commented 10 months ago

There's apparently no download/maven metadata API for the equivalent listing on their project page

https://projects.neoforged.net/neoforged/neoforge

The documented maven metadata only includes 1.20.1 versions:

https://maven.neoforged.net/releases/net/neoforged/forge/maven-metadata.xml

The "new" maven metadata is useless since it does not include any Minecraft version qualifiers

https://maven.neoforged.net/releases/net/neoforged/neoforge/maven-metadata.xml

shayanz23 commented 10 months ago

Does the maven metadata have to include minecraft version qualifiers? Because the mod versions correspond to the minecraft version they're for. eg 20.4.57-beta is for minecraft 1.20.4.

itzg commented 10 months ago

Does the maven metadata have to include minecraft version qualifiers? Because the mod versions correspond to the minecraft version they're for. eg 20.4.57-beta is for minecraft 1.20.4.

How would software know that association? How did you know that association? What NeoForge versions go with 1.20.2?

itzg commented 10 months ago

Whatever mechanism is used to populate these two drop downs needs to be exposed for automation:

image

itzg commented 10 months ago

For comparison, all of those version mappings are available for Forge in

https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json

And Fabric provides an installer for all supported version combinations

https://fabricmc.net/use/installer/

shayanz23 commented 10 months ago

I found the association while using the Prism launcher, which showed that Minecraft 1.20.4 has Neoforge 20.4.57-beta, 1.20.3 has 20.3.8-beta and 1.20.2 having 20.2.86. I'm not entirely sure if this is correct though, and it is weird that they don't explicitly state the Minecraft versions.

itzg commented 10 months ago

As I showed in the screenshot, NeoForge also "shows" the association. Again, it's only useful if software can retrieve it. Now I'm wondering how Prism launcher is able to do that -- the same thing would be useful for the needed automation.

itzg commented 10 months ago

Looking at Prism Launcher metadata processing code I figured it out. The major.minor part of NeoForge versions correspond to the minor.patch part of Minecraft versions:

image