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

[Bug] Doesn't recognize mods.toml if forge dependency is omitted #139

Open
meza opened this issue Dec 24, 2024 · 2 comments
Open

[Bug] Doesn't recognize mods.toml if forge dependency is omitted #139

meza opened this issue Dec 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@meza
Copy link

meza commented Dec 24, 2024

Description

Hey, I'm using the action to successfully deploy fabric, forge, neoforge projects.

I've just now switched to a method where I let the action to determine the game version for the files.

Here's an example project: https://github.com/meza/Disable-Christmas-Chests/blob/main/.github/workflows/build.yml

Here's a mods.toml it generates and uses in the jar:

modLoader = "javafml"
loaderVersion = "*"
issueTrackerURL = "https://github.com/meza/Disable-Christmas-Chests/issues"
license = "GPL-3.0"

[[mods]]
modId = "disablechristmaschests"
version = "0.0-SNAPSHOT"
displayName = "Disable Christmas Chests"
authors = "Meza"
description = '''
Disables Christmas Chests from appearing in the world.
'''
logoFile = "assets/disablechristmaschests/nochest.png"
logoBlur = false

[[dependencies.disablechristmaschests]]
modId = "minecraft"
mandatory = true
versionRange = "[1.21.4,)"
ordering = "NONE"
side = "BOTH"

Expected Behavior

I expect the uploaded files to have the correct game versions set

Actual Behavior

The actual behaviour is that it sets all major releases from 1.0 onwards

Version

3.3

Environment

GitHub Actions

Configuration

No response

Logs

No response

Other Information

No response

@meza meza added the bug Something isn't working label Dec 24, 2024
@Kir-Antipov
Copy link
Owner

Kir-Antipov commented Dec 24, 2024

Hi! This issue should probably be split into two parts.

First, mc-publish should have raised an error indicating that no game versions were specified, instead of automatically throwing every Minecraft version in existence at you. Second, I would indeed expect mc-publish to succeed in this case as well.

You are encountering the same problem described in #130. Due to the Forge/NeoForge separation, I added a safeguard to the parsing logic, which forces mc-publish to recognize mods.toml as a Forge metadata file only if there is an explicit dependency on Forge (and similarly for NeoForge). This is because for quite some time in the past the mods.toml file was used by both Forge and NeoForge.

Since your mods.toml file doesn't specify a dependency on Forge, mc-publish cannot determine whether it's a metadata file for Forge or NeoForge. As a result, it fails to parse the file whatsoever. To resolve this issue, you can add something like the following to your metadata:

[[dependencies.disablechristmaschests]]
modId = "forge"
mandatory = true
versionRange = "*"
ordering = "NONE"
side = "BOTH"

After that, the problem will go away and you should be golden. Apologies for the inconvenience!

Given that NeoForge has parted its ways with mods.toml, I may remove the safeguard entirely and allow mc-publish to treat mods.toml as a Forge metadata file by default again, even if no explicit dependency on forge is specified.

@Kir-Antipov Kir-Antipov changed the title [Bug] Forge version doesn't parse [Bug] Doesn't recognize mods.toml if forge dependency is omitted Dec 24, 2024
@meza
Copy link
Author

meza commented Dec 24, 2024

Thanks for the response, I shall add this back in! Had the same issue with Forge but I would assume that it's the exact same problem

UpcraftLP added a commit to Up-Mods/OkZoomer that referenced this issue Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants