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

1.21.1 - ATM10 - The Undergarden + Silent Gear + Baritone causes crash #4538

Open
4 tasks done
MirekStanek opened this issue Oct 28, 2024 · 9 comments
Open
4 tasks done
Labels
bug Something isn't working

Comments

@MirekStanek
Copy link

Some information

Operating system: Windows 11 Pro (23H2)
Java version: Java 8 Update 421
Minecraft version: 1.21.1
Baritone version: baritone-api-neoforge-1.10.2-9-g3b01f129
Other mods (if used): The Undergarden, Silent Gear (+lib)
Neoforge version: 21.1.72

Exception, error or logs

I will provide three files, just to be sure. One is with both mods enabled and the other two are with one disabled.
crash_silent_undergarden_on.txt
crash_silent_off.txt
crash_undergarden_off.txt

How to reproduce

Download ATM10 and add Baritone. You will not be able to create world as it always crashes game before it gets a chance.
OR
Create custom modpack with said mods and add baritone. Same behaviour.

Modified settings

None.

Final checklist

  • I know how to properly use check boxes
  • I have included the version of Minecraft I'm running, baritone's version and forge mods (if used).
  • I have included logs, exceptions and / or steps to reproduce the issue.
  • I have not used any OwO's or UwU's in this issue.

I think that this is my first time ever posting an issue, so if I missed something, just let me know. Thank you for making this mod as it saves my time so I can grind less and spend more time with family after job.

@MirekStanek MirekStanek added the bug Something isn't working label Oct 28, 2024
@MirekStanek MirekStanek changed the title ATM10 - The Undergarden + Silent Gear + Baritone causes crash 1.21.1 - ATM10 - The Undergarden + Silent Gear + Baritone causes crash Oct 28, 2024
@MirekStanek
Copy link
Author

Forgot to provide mod verions:
silent-gear-1.21.1-neoforge-4.0.8.
The_Undergarden-1.21.1-0.8.22

@ZacSharp
Copy link
Collaborator

This is two different incompatibilities.

  1. Undergarden seems to assume nobody will ever query the damage value of an ItemStack before a world is loaded. I'd blame that on them since Minecraft does construct ItemStacks before world load and assuming that no mod will query the damage of one of those stacks seems rather brittle.
  2. Silentlib somehow wants to construct a new ItemStack every time one of its items is asked for its damage, and Baritone reads the damage of every new ItemStack, leading to infinite recursion. While I think constructing a new ItemStack in getDamage is a weird thing to do, I also think this one is on Baritone to fix.

Also I might have to read some mc code again to check whether the hashing trick Baritone is doing is even needed/correct. Now that ItemStacks use immutable components there might be better ways to get what we want.

@MirekStanek
Copy link
Author

I have little to no idea what you just said here, but I am grateful for your knowledge! Happy coding!

@imfakeheart
Copy link

is there a way to fix it?

@MirekStanek
Copy link
Author

is there a way to fix it?

@imfakeheart I did not find a way. You can only disable both of the mods and then it works, but since these mods have quest lines, I just gave up on Baritone for now.

We can only hope that @ZacSharp will manage to at least fix SilentLib issue, since The Undergarden might not be fixable from his side (based on his comment).

@ZacSharp
Copy link
Collaborator

ZacSharp commented Nov 28, 2024

The problem is that I don't even get to test simple prs like the latest merge pr I opened and reading up on mc internals takes more time than that. (Testing also has constraints like having the right PC nearby)
Someone else having a look at this could definitely speed things up.

@imfakeheart
Copy link

of course, idk much about other languages besides PAWN, which i have mastered perfectly, but i learn very quickly, so if you direct me in the right direction, i can try to fix this bug

@GizmoTheMoonPig
Copy link

Hey, just wanted to let you guys know I was just made aware of the Undergarden side of this issue and have a fix pushed. I'll get a build uploaded to CF when I get some time

@ZacSharp
Copy link
Collaborator

ZacSharp commented Dec 14, 2024

Thank you.

That leaves the harder one open. For newer versions I think the fix is hashing a selected subset of data components rather than the damage value, for 1.19.4 I don't know. From Baritones side we are already just reading a field without running code, but Neoforge turns that field into an accessor method, which silentlib turns into a recursion crash. The only idea I got to sidestep this is calculating the hash lazily.

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

4 participants