Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

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

MirekStanek opened this issue ยท 9 comments

commented

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.

commented

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

commented

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.

commented

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

commented

is there a way to fix it?

commented

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).

commented

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

commented

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.

commented

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

commented

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.