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

Automodpack won't work with Sodium for 1.21 NeoForge #246

Closed
2 tasks done
Logan9312 opened this issue Jul 4, 2024 · 12 comments
Closed
2 tasks done

Automodpack won't work with Sodium for 1.21 NeoForge #246

Logan9312 opened this issue Jul 4, 2024 · 12 comments
Labels
bug Something isn't working help wanted Extra attention is needed incompatibility The mod is not compatible with AutoModpack

Comments

@Logan9312
Copy link

Bug description

When using the new 1.21 build of sodium, it will not add automodpack.

I'm wondering if it is because of the mod being treated as a library file not a mod file:
[16:43:05] [main/INFO]: Found library file "sodium-neoforge-1.21-0.6.0-alpha.1.jar" [locator: pl.skidam.automodpack_loader_core.EarlyModLocator@779dfe55, reader: mod manifest]

Steps to reproduce

  1. Add Automodpack to a world
  2. Extract and add Attached Sodium build to the automodpack/host-modpack/main/mods folder
    sodium-neoforge-1.21-0.6.0-alpha.1.zip
  3. Launch client with sodium loaded from automodpack, it does not add sodium to the game

Expected behavior

No response

Actual behavior

No response

Relevant logs

latest.log

Minecraft & Mod Loader versions

1.21 NeoForge 21.0.56

Minecraft launcher

CurseForge

Operating system

Windows 11

AutoModpack version

automodpack-neoforge-4.0.0-beta6-1.21.0

Other information

No response

Check list

  • I have verified that the issue persists in the latest version of the mod.
  • I have searched the existing issues and confirmed that this is not a duplicate.
@Logan9312 Logan9312 changed the title Automodloader won't work with Sodium for 1.21 NeoForge Automodpack won't work with Sodium for 1.21 NeoForge Jul 4, 2024
@IMS212
Copy link

IMS212 commented Jul 5, 2024

I'm willing to add a custom manifest entry into the mod, if that makes it easier to detect it.

@Logan9312
Copy link
Author

Sure whatever works, if there’s any config I can do on my end to let it add it that would work too. I wasn’t sure if it was on the mod’s end or automodpack, but I assumed it was an automodpack thing because it works when adding normally.

@Skidamek
Copy link
Owner

Skidamek commented Jul 5, 2024

I'm willing to add a custom manifest entry into the mod, if that makes it easier to detect it.

Thanks, not needed, on sodium/iris side everything is right.

It's related to #214 the problem lies in fact that automodpack loads mods from separate directory from its mod locator but sodium is providing its own mod locator which then isn't run from neoforge itself because neoforge already ran locators from already loaded mods (e.g. from standard mods directory ~/mods/) like automodpack and so that means automodpack needs to copy a little of neoforge code and run other mods locators.

But it is not as simple as it seems or i am just not knowledgeable enough doing that yet, i tried to do that on forge 1.20.1.

When this is run it just throws very strange exception at least with Sinytra Connector mod.

Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
	at org.sinytra.connector.locator.ConnectorEarlyLocator.scanCandidates(ConnectorEarlyLocator.java:52)
	at MC-BOOTSTRAP/fmlloader@1.20.1-47.3.4/net.minecraftforge.fml.loading.moddiscovery.AbstractJarFileModLocator.scanMods(AbstractJarFileModLocator.java:19)
	at LAYER SERVICE/automodpack.forge.beta6@4.0.0-beta6-1.20.1/pl.skidam.automodpack_loader_core.EarlyModLocator.lambda$discoverMods$6(EarlyModLocator.java:160)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.RuntimeException: java.nio.file.FileSystemException: /home/skidam/.var/app/org.prismlauncher.PrismLauncher/data/PrismLauncher/instances/forge 1.20.1 test/.minecraft/automodpack/modpacks/server/mods/Connector-1.0.0-beta.44+1.20.1.jar/META-INF/MANIFEST.MF: Not a directory
	at org.sinytra.connector.locator.EmbeddedDependencies.readManifestAttributes(EmbeddedDependencies.java:108)
	at org.sinytra.connector.locator.EmbeddedDependencies.<clinit>(EmbeddedDependencies.java:51)
	... 4 more
Caused by: java.nio.file.FileSystemException: /home/skidam/.var/app/org.prismlauncher.PrismLauncher/data/PrismLauncher/instances/forge 1.20.1 test/.minecraft/automodpack/modpacks/server/mods/Connector-1.0.0-beta.44+1.20.1.jar/META-INF/MANIFEST.MF: Not a directory
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:379)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:431)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
	at java.base/java.nio.file.Files.newInputStream(Files.java:159)
	at org.sinytra.connector.locator.EmbeddedDependencies.readManifestAttributes(EmbeddedDependencies.java:105)
	... 5 more

But this same code ran directly from neo/forge just works. However to get to this point it had to run a bunch of other lines of code from connector mod locator so that may mean that if i port it to neoforge 1.21 and sodium doesn't do anything related to paths and filesystem then it might just work...

Any help is appreciated since it is kind of dealing with neo/forge internals which are complicated...

@Skidamek Skidamek added bug Something isn't working help wanted Extra attention is needed incompatibility The mod is not compatible with AutoModpack labels Jul 5, 2024
@Logan9312
Copy link
Author

Is it possible it’s just a bug on the Sinytra connector end? The main issue I was getting was on the neoforge end without connector mod, so at least if it works there that’s a good step

@Skidamek
Copy link
Owner

Skidamek commented Jul 5, 2024

No its not bug in connector, i am just struggling to handle these mod locators properly.

Until its not fixed in automodpack, i can make a workaround for these mods (mods which add services/locators) that they will be just dropped to the standard ~/mods/ directory. Which will work, i don't like it but it will be better since that will work.

Disadvantages of this solution are gonna be that modpack mods wont be nicely sorted and automodpack wont have control of loading them so if there will be update to them, you will always need to manually reboot the game. Currently the greatest advantage of it being in different directory is that if we check for modpack update on boot (super early) we can update whole modpack and load it without relaunching the game at all.

@Logan9312
Copy link
Author

I think the workaround would be good, at least some functionality is better than nothing until a better fix is found. Either way though the mods are still usable for now at least, we can put them in manually until one of the solutions is added

@Skidamek
Copy link
Owner

Skidamek commented Jul 5, 2024

Ok, I've initially implemented workaround for these mods, so far from my limited testing it seems to work fine. Could you try it? Here you download zipped dev build its big because it contains all the versions.

Skidamek added a commit that referenced this issue Jul 5, 2024
#214 #246
things todo/test:
 if that mod has a dependency and if so also move it as workaround to standard mods directory
@Logan9312
Copy link
Author

Just tested on neoforge with the 1.21 update you gave and it works, thanks!

@Logan9312
Copy link
Author

Small side note, when I put the dev version on my server it didn't automatically sync with the clients. I had to update my client manually. I assume this is intended but wanted to mention it in case

@Skidamek
Copy link
Owner

Skidamek commented Jul 6, 2024

Small side note, when I put the dev version on my server it didn't automatically sync with the clients. I had to update my client manually. I assume this is intended but wanted to mention it in case

It's definitely not intended, are you sure you have regenerated the modpack?

Oh wait you mean the dev version of automodpack? Then yes that's intended, it only syncs versions downloadable from modrinth

@Logan9312
Copy link
Author

Yes correct, automodpack dev version.

For the fixed sodium behaviour I needed to manually set automodpack on client and server, if that's intended then perfect. Everything is working as it should.

Also noticed another side effect of the new behaviour which isn't really an issue. My curseforge was empty before except for automodpack, but now many mods get thrown into the main curseforge page, I'm assuming since they get put into the main mods folder.

@Skidamek
Copy link
Owner

Skidamek commented Jul 6, 2024

Correct intended.

Could you give list of mods which are copied to the standard mods folder? I assume it's not all the mods from modpack, right?

Currently it copies all mods which have services folder but that might not be needed, if so I will only check for specific services like mod locator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed incompatibility The mod is not compatible with AutoModpack
Projects
None yet
Development

No branches or pull requests

3 participants