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

Confusion about mismatched/duplicated project slugs #15

Closed
Wxrlds opened this issue Jun 23, 2024 · 5 comments
Closed

Confusion about mismatched/duplicated project slugs #15

Wxrlds opened this issue Jun 23, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Wxrlds
Copy link
Contributor

Wxrlds commented Jun 23, 2024

I'm in the process of setting up a multiplatform project and stumbled across this issue with the "Chameleon" mod.

Essentially, the program is getting confused when the project slug for a mod is used by another mod on the other platform.

Probably easiest to understand if I give an example:

The Chameleon mod on Curseforge has the chameleon slug, while the same Chameleon mod on Modrinth has the texel-chameleon slug.

The issue is that on Modrinth, there is another Mod that has the chameleon slug, causing the program to do weird things.

java -jar pakku.jar add rZrAKGe1:rwV3yGi9
> {mr=texel-chameleon} was not found on CurseForge.
Specify CurseForge: 230497
> {modrinth=chameleon, curseforge=chameleon} versions do not match across platforms.
   [modrinth: Chameleon-1.12.2-4.1.3.jar, curseforge: Chameleon-1.12-4.1.3.jar]

The interesting part is what gets written to the pakku-lock.json

  1. The slug and id of the modrinth id is not the same slug from the add command
  2. The file_name and url of the modrinth version are correct
{
            "pakku_id": "rRtVmg3bmRaIy308",
            "type": "MOD",
            "side": "BOTH",
            "slug": {
                "modrinth": "chameleon",
                "curseforge": "chameleon"
            },
            "name": {
                "modrinth": "Chameleon",
                "curseforge": "Chameleon"
            },
            "id": {
                "modrinth": "DNMzKpyW",
                "curseforge": "230497"
            },
            "files": [
                {
                    "type": "modrinth",
                    "file_name": "Chameleon-1.12.2-4.1.3.jar",
                    "mc_versions": [
                        "1.12",
                        "1.12.1",
                        "1.12.2"
                    ],
                    "loaders": [
                        "forge"
                    ],
                    "release_type": "release",
                    "url": "https://cdn.modrinth.com/data/rZrAKGe1/versions/rwV3yGi9/Chameleon-1.12.2-4.1.3.jar",
                    "id": "rwV3yGi9",
                    "parent_id": "rZrAKGe1",
                    "hashes": {
                        "sha512": "50def09ba7c254adc7cbcf21a8d52f3e17beee59003d779a2f3bcde627270474183e9e0d0592f4e314b37922a91ab364e60290bc7a0c4cc7bf6c17cc4e52c0c0",
                        "sha1": "77c74d2311db380ba8251617b131f2f7fe5a7b44"
                    },
                    "required_dependencies": [
                    ],
                    "size": 94972
                },
                {
                    "type": "curseforge",
                    "file_name": "Chameleon-1.12-4.1.3.jar",
                    "mc_versions": [
                        "1.12.1",
                        "1.12",
                        "1.12.2"
                    ],
                    "release_type": "release",
                    "url": "https://edge.forgecdn.net/files/2450/900/Chameleon-1.12-4.1.3.jar",
                    "id": "2450900",
                    "parent_id": "230497",
                    "hashes": {
                        "sha1": "5ed3dd5fd1ebded57bfe525b4ece11232bd14e5e",
                        "md5": "e42efa8f4fd42d2918128a826b740e98"
                    },
                    "required_dependencies": [
                    ],
                    "size": 96859
                }
            ]
        }

It probably doesn't help that the author uploaded two different files

@juraj-hrivnak juraj-hrivnak added the bug Something isn't working label Jun 23, 2024
@juraj-hrivnak
Copy link
Owner

One solution is to replace the wrong slug in the lock file with the correct slug.

@juraj-hrivnak
Copy link
Owner

Pakku could ask before assuming the other slug is correct. I will see what I can do.

@juraj-hrivnak juraj-hrivnak self-assigned this Jun 24, 2024
@Wxrlds
Copy link
Contributor Author

Wxrlds commented Jul 24, 2024

Putting this here to document some more mods that have the same issue cause

The Iris Shader Mod has the same issue but causes the program to crash entirely:

❯❯❯ {cf=irisshaders} was not found on Modrinth.
Specify Modrinth: iris
teksturepako.pakku.api.data.PakkuException: Can not combine two projects of different type! Project(pakkuId=iE8eT4slmi54hPf1, pakkuLinks=[], type=WORLD, side=null, slug={curseforge=iris}, name={curseforge=Iris}, id={curseforge=715898}, updateStrategy=LATEST, redistributable=false, files=[]) WORLD + Project(pakkuId=sHj18EhUXxDFNQN5, pakkuLinks=[], type=MOD, side=CLIENT, slug={modrinth=iris}, name={modrinth=Iris Shaders}, id={modrinth=YL57xq9U}, updateStrategy=LATEST, redistributable=true, files=[]) MOD
	at teksturepako.pakku.api.projects.Project.plus(Project.kt:49)
	at teksturepako.pakku.api.platforms.Multiplatform.requestProject(Multiplatform.kt:50)
	at teksturepako.pakku.api.platforms.Multiplatform$requestProject$1.invokeSuspend(Multiplatform.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at teksturepako.pakku.cli.cmd.Import.run(Import.kt:33)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:306)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:319)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:40)
	at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:458)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:455)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:475)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:482)
	at teksturepako.pakku.MainKt.main(Main.kt:31)
Error: Modrinth kotlin.Unit

Reason is because on Curseforge the Iris mod has the slug irisshaders but also on CurseForge, there is a "Minecraft Worlds" project with the slug iris
https://www.curseforge.com/minecraft/worlds/iris

On Modrinth the Iris Shader Mod has the slug iris

@juraj-hrivnak
Copy link
Owner

The Iris Shader Mod has the same issue but causes the program to crash entirely:

Thanks. This is a good reminder that the exception should be an error instead.

@juraj-hrivnak
Copy link
Owner

juraj-hrivnak commented Aug 30, 2024

Released in v0.16.0.

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